Welcome to the Learning Pandas repository! This project documents my journey in mastering the Pandas library for data manipulation and analysis in Python. It contains a collection of organized examples and demos ranging from basic Series and DataFrames to more advanced operations like joining and concatenation.
The code is organized into folders based on the specific Pandas concept being demonstrated:
Basic examples of creating and manipulating DataFrames.
- Creating DataFrames from dictionaries.
- Custom indexing (
index=['RowA', ...]). - Accessing data using
.locand.iloc. - Iterating over columns.
Exploring built-in attributes and methods to inspect DataFrames.
- Attributes:
.dtypes,.ndim(dimensions),.size(number of elements),.shape(tuple of rows/cols),.index,.T(Transpose). - Methods:
.head()(first n rows),.tail()(last n rows).
- Demonstrations of joining two DataFrames using the
.join()method.
- Examples of combining DataFrames vertically using
pd.concat().
Introduction to the 1-dimensional Series data structure.
- Creating Series from lists.
- Using custom row labels/indexes.
- Accessing values by label or position.
Deep dive into Series inspection and manipulation.
- Attributes:
.dtype,.ndim,.size,.name,.index,.hasnans(checking for NaNs). - Methods:
.head(),.tail(),.info()(summary).
- Using the
.combine()method with custom functions to merge data from two Series.
- Working with memory-efficient
categorydata types in both Series and DataFrames.
Make sure you have Python installed along with the Pandas library.
pip install pandasYou can run any of the demo scripts individually to see the output. For example:
python "01_Pandas DataFrame/Pandas_DataFrame_Demo-1.py"- Python: Programming language.
- Pandas: Data manipulation library.
- NumPy: Used for numerical operations and
np.NaN. - PyCharm: IDE (indicated by the
.ideaconfiguration files).
Created by Dharm Patel