技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
pandas【数据与研究】Assists with loading, cleaning, transforming, and analyzing tabular data using pandas. Use when importing CSV/Excel/SQL data, handling missing values, performing groupby aggregations, merging datasets, working with time series, or building analysis-ready datasets. Trigger words: pandas, dataframe, csv, groupby, merge, time series, data cleaning.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Pandas is a Python library for loading, cleaning, transforming, and analyzing tabular data. It provides DataFrames for structured data manipulation, supports CSV, Excel, SQL, JSON, and Parquet formats, and offers powerful groupby aggregation, merge/join operations, time series resampling, and method chaining for building analysis pipelines.
pd.read_parquet() for large datasets (faster, smaller, type-preserving), pd.read_csv() with explicit dtype for CSVs, and pd.read_sql() for database queries.fillna() or dropna(), deduplicate with drop_duplicates(), use string methods (.str.strip(), .str.lower()) for text cleaning, and convert types explicitly with astype() and pd.to_datetime().assign() for computed columns, pipe() for method chaining, melt() and pivot_table() for reshaping, and pd.cut()/pd.qcut() for binning.groupby().agg() with named aggregation for readable column names, transform() to broadcast results back to original shape, and resample() for time-based grouping.pd.merge() with explicit how and validate parameters to catch data quality issues at merge time, and pd.concat() for stacking DataFrames.category dtype for low-cardinality strings, vectorized operations over .apply(), and Parquet for storage; for datasets over 10GB, consider Polars or DuckDB.User request: "Load a messy CSV of sales data, clean it, and generate monthly revenue summaries"
Actions:
pd.read_csv() specifying dtype and parse_dates for key columnsassign()resample("M").agg() for revenue, order count, and average order valueOutput: A clean DataFrame with monthly revenue summaries ready for visualization or reporting.
User request: "Join customer data from CRM, transactions, and support tickets into a single view"
Actions:
pd.merge(on="customer_id", how="left", validate="one_to_many")Output: A unified customer DataFrame with CRM info, transaction history, and support metrics.
pd.read_parquet() for intermediate and output files since it is faster, smaller, and preserves types..pipe() for readable and testable code..agg() for self-documenting column names.dtype explicitly on read_csv() for large files since type inference reads the full file twice.category dtype for columns with fewer than 1000 unique values for significant memory savings.validate="one_to_many" to catch data quality issues at merge time.query() for complex filters instead of chained boolean indexing for better readability.