Getting Started with Pandas DataFrames
After exploring Pandas Series, today I dived into DataFrames β the backbone of Pandas and data analysis.
πΉ Creating a DataFrame
import pandas as pd
data = {
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 35],
"City": ["NY", "LA", "Chicago"]
}
df = pd.DataFrame(data)
print(df)
β Output:
Name Age City
0 Alice 25 NY
1 Bob 30 LA
2 Charlie 35 Chicago
πΉ Fun Facts about DataFrames
β’ Theyβre like Excel sheets in Python π
β’ Built on NumPy arrays β super fast
β’ Support powerful operations: filtering, grouping, merging, pivoting
β’ Widely used in data science, finance, ML, and business analytics
β¨ Reflection
DataFrames are where Python starts feeling like a real data playground. Excited to explore filtering and analysis next! π
Top comments (0)