Data Analysis with pandas: A Comprehensive Guide to DataFrame and Series Classes, Slides of Programming Languages

python programming language for finance fields

Typology: Slides

2022/2023

Uploaded on 11/07/2023

emelia-goh
emelia-goh 🇹🇭

5 documents

1 / 61

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Data Analysis with pandas
1
This session is about pandas library àit is popularly used for data analysis, especially
tabular data
Provides numerous classes and functions for data manipulation
Wraps functionality from other packages for enhanced capabilities
Offers a user-friendly interface for efficient data analysis
Ideal for financial analysis and other data-driven tasks
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d

Partial preview of the text

Download Data Analysis with pandas: A Comprehensive Guide to DataFrame and Series Classes and more Slides Programming Languages in PDF only on Docsity!

Data Analysis with pandas

  • This session is about pandas library à it is popularly used for data analysis, especially tabular data
  • Provides numerous classes and functions for data manipulation
  • Wraps functionality from other packages for enhanced capabilities
  • Offers a user-friendly interface for efficient data analysis
  • Ideal for financial analysis and other data-driven tasks

The DataFrame Class

  • Pandas DataFrame is the core class for handling tabular data efficiently
  • DataFrames feature columnar organization, column labeling, and flexible row indexing
  • Comparable to a table in a relational database or an Excel spreadsheet
  • This section covers fundamental aspects of the pandas DataFrame class
  • The class is complex and powerful with many capabilities
  • Subsequent chapters provide more examples and explore different aspects

First Steos with the DataFrame Class

  • The example shows some major features of the DataFrame class when it comes to storing data: o Data itself can be provided in different shapes and types (list, tuple, ndarray, and dict objects are candidates) o Data is organized in columns, which can have custom names (labels) o There is an index that can take on different formats (e.g. number, strings, time information)
  • DataFrame objects provide convenient and efficient handling compared to ndarray objects.
  • ndarray objects are more specialized and restrictive, especially when enlarging existing objects.

First Steos with the DataFrame Class

  • DataFrame objects provide convenient and efficient handling compared to ndarray objects.
  • ndarray objects are more specialized and restrictive, especially when enlarging existing objects.
  • Both DataFrame and ndarray objects offer comparable computational efficiency.

First Steos with the DataFrame Class

  • Cont.

First Steos with the DataFrame Class

  • Contrary to NumPy ndarray objects, enlarging the DataFrame object in both dimensions is possible

First Steos with the DataFrame Class

  • Appending data works similarly à however, in the following example, the index gets replaced by a simple range index:

First Steos with the DataFrame Class

  • Cont.

First Steos with the DataFrame Class

  • Although there are now missing values à the majority of methods calls will still work

Second Steps with the DataFrame Class

  • Example based on ndarray object containing standard normally distributed random numbers
  • Demonstrates additional features, including DatetimeIndex
  • DatetimeIndex used for managing time series data

Second Steps with the DataFrame Class

  • The following table lists the parameters that the DataFrame() function takes

Second Steps with the DataFrame Class

  • DataFrame objects have column names, similar to structured arrays.
  • Column names can be defined by assigning a list object with the appropriate number of elements.
  • This demonstrates the ease of defining or modifying DataFrame object attributes.

Second Steps with the DataFrame Class

  • The following table lists the parameters that the data_range() function takes

Second Steps with the DataFrame Class

  • We can read DatetimeIndex object as the relevant index object, making a time series of the original data set