-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
milisp edited this page Oct 23, 2024
·
1 revision
This guide will help you get up and running with Panars quickly.
After installation, you can import Panars in your Python script:
import panars as paYou can create a DataFrame using a dictionary, similar to Pandas:
df = pa.DataFrame({
"A": [1, 2, 3, 4],
"B": [5, 6, 7, 8],
"C": ["a", "b", "a", "b"]
})Here are some basic operations you can perform with Panars:
# Display the first few rows
print(df.head())
# Display basic information about the DataFrame
print(df.info())
# Get summary statistics
print(df.describe())# Filter rows where column A is greater than 2
filtered_df = df[df["A"] > 2]# Group by column C and calculate mean of A and sum of B
result = df.groupby("C").agg({"A": "mean", "B": "sum"})# Sort the DataFrame by column B in descending order
sorted_df = df.sort_values("B", ascending=False)- Explore the API Reference for detailed information on available methods and functions.
- Check out the Examples page for more complex usage scenarios.
- If you're migrating from Pandas, see our Migration Guide for tips on transitioning your code.