Pandas is a powerful open-source data manipulation and analysis library for Python. It provides data structures like DataFrames and Series, making data cleaning, transformation, and analysis seamless and efficient.
Installation:
pip install pandas
Key Features:
- DataFrame object for data manipulation with integrated indexing
- Tools for reading and writing data between in-memory data structures and different formats (CSV, Excel, SQL, JSON)
- Data alignment and integrated handling of missing data
- Reshaping and pivoting of data sets, label-based slicing, indexing, and subsetting
Code Example:
import pandas as pd
# Create DataFrame
data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]}
df = pd.DataFrame(data)
print("DataFrame:")
print(df)
print("Mean Age:", df['Age'].mean())
No comments:
Post a Comment