Learn Pandas for data analysis and manipulation with hands-on examples and clear explanations.
Pandas is a powerful Python library for data manipulation and analysis. It provides data structures like Series and DataFrame for handling structured data.
import pandas as pd
data = {'Name': ['Alice', 'Bob'], 'Age': [25, 30]}
df = pd.DataFrame(data)
print(df)
Create a simple DataFrame and print it.
Pandas makes it easy to read data from CSV files into DataFrames for analysis.
import pandas as pd
df = pd.read_csv('data.csv')
print(df.head())
Read a CSV file and display the first five rows.
You can select columns, rows, and filter data in Pandas using intuitive syntax.
import pandas as pd
df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
print(df['A']) # Select column
print(df[df['B'] > 4]) # Filter rows
Select a column and filter rows in a DataFrame.