core-dataframes
Create and manipulate Koalas DataFrame, Series, and Index objects with pandas-like APIs and conversion guidance.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- core-dataframes
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Create and manipulate Koalas DataFrame, Series, and Index objects with pandas-like APIs and conversion guidance.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md10.2 KB
- 参考文档references/troubleshooting.md9.6 KB
- 参考文档references/workflows.md7.5 KB
- 脚本scripts/koalas_dataframe_quickstart.py5.2 KB
03 SKILL.md 正文
Koalas core DataFrames router
Use this sub-skill when the task is about creating, converting, indexing, reshaping, cleaning, typing, or summarizing Koalas DataFrame, Series, and Index objects with pandas-like APIs.
Handle here
- Constructors and conversion:
databricks.koalas as ks,ks.DataFrame,ks.Series,ks.Index,ks.from_pandas,ks.range,to_pandas, andto_spark(index_col=...)when the focus is preserving or avoiding a default index. - Top-level dataframe functions:
ks.concat,ks.merge,ks.melt,ks.get_dummies,ks.to_datetime,ks.date_range,ks.isna/isnull/notna/notnull, andks.to_numeric. - Selection and indexing:
df[...], attribute column access when safe,loc,iloc,at,iat,head,tail,where,mask,query,set_index, andreset_index. - Core object APIs: dtype inspection and
astype, missing-data operations, string accessorSeries.str, datetime accessorSeries.dt, categorical accessorSeries.cat, index and MultiIndex basics, and descriptive statistics. - Pandas migration decisions: when a pandas snippet can be translated directly, when duplicate/case-sensitive/reserved columns must be fixed, and when
to_pandas()is acceptable only for bounded data.
Route elsewhere
- Spark sessions, storage formats, Spark SQL, readers/writers,
.sparkaccessor depth, JDBC, and production Spark IO: spark-io-sql. apply,transform,map_in_pandas,groupby, rolling, expanding, window, and return type-hint depth: apply-groupby-window.- Koalas options, plotting, custom accessors/extensions, optional dependencies, and global performance switches: configuration-extensions.
Operating references
- Start with API reference for supported constructors, methods, signatures, and known API gaps.
- Use workflows for concrete migration, creation, conversion, indexing, reshape, dtype, missing, string, datetime, categorical, and statistics recipes.
- Use troubleshooting for unsupported pandas APIs, duplicate/case-sensitive columns, reserved
__column__-style names, pandas collection risks, non-iterability, default-index cost, and dtype gotchas. - For a safe runtime probe, run scripts/koalas_dataframe_quickstart.py with
--check import,--check dataframe, or--check all.
Default decision rules
- Keep data in Koalas/Spark for distributed work; use
to_pandas()only after a boundedhead, sample, filter, or other proof that the result fits driver memory. - Prefer
ks.from_pandas(pdf)for migration tests and tiny fixtures. For Spark interop, preserve an index withto_spark(index_col="...")andsdf.to_koalas(index_col="...")when an existing column can serve as the index. - Reject or rename duplicate columns, case-only duplicate columns such as
a/A, and names wrapped in double underscores before relying on selection or Spark conversion. - For pandas code that iterates over a
Seriesor expects local arrays, rewrite to Koalas vectorized APIs or explicitly collect withto_numpy()/to_pandas()after bounding data size.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).