Loading...
Loading...
Expert guidance for data analysis, visualization, and Jupyter Notebook development with pandas, matplotlib, seaborn, and numpy.
npx skill4agent add mindrally/skills data-analysis-jupyter# Example method chaining pattern
result = (
df
.query("column_a > 0")
.assign(new_col=lambda x: x["col_b"] * 2)
.groupby("category")
.agg({"value": ["mean", "sum"]})
.reset_index()
)# Example visualization pattern
fig, ax = plt.subplots(figsize=(10, 6))
sns.barplot(data=df, x="category", y="value", ax=ax)
ax.set_title("Descriptive Title")
ax.set_xlabel("Category Label")
ax.set_ylabel("Value Label")
plt.tight_layout()# Example numpy patterns
np.random.seed(42) # For reproducibility
mask = np.where(arr > threshold, 1, 0)
normalized = (arr - arr.mean()) / arr.std()# Example validation pattern
assert df.shape[0] > 0, "DataFrame is empty"
assert "required_column" in df.columns, "Missing required column"
df["date"] = pd.to_datetime(df["date"], errors="coerce")# Example categorical optimization
df["category"] = df["category"].astype("category")
# Chunked reading for large files
chunks = pd.read_csv("large_file.csv", chunksize=10000)
result = pd.concat([process(chunk) for chunk in chunks])