CallOp
Sub classes¶
| Name | Children | Inherits |
|---|---|---|
| DropColumns datacook.engine.ops.columns |
||
| RenameColumns datacook.engine.ops.columns |
||
| ChangeDtypes datacook.engine.ops.columns |
||
| SortColumns datacook.engine.ops.columns |
||
| AddPrefix datacook.engine.ops.columns |
||
| AddSuffix datacook.engine.ops.columns |
||
| SelectDtypes datacook.engine.ops.columns |
||
| ConvertDtypes datacook.engine.ops.columns |
||
| CalculateColumns datacook.engine.ops.columns |
||
| Merge datacook.engine.ops.combine |
||
| FillMissing datacook.engine.ops.missing |
||
| DropMissing datacook.engine.ops.missing |
||
| DropMissingColumns datacook.engine.ops.missing |
||
| IsMissing datacook.engine.ops.missing |
||
| Unpivot datacook.engine.ops.reshape |
||
| Pivot datacook.engine.ops.reshape `df.pivot_table(...)`: one value column, one column whose values become columns. |
||
| FilterRows datacook.engine.ops.rows |
||
| SortRows datacook.engine.ops.rows |
||
| Head datacook.engine.ops.rows |
||
| Sample datacook.engine.ops.rows |
||
| DropDuplicates datacook.engine.ops.rows |
||
| NLargest datacook.engine.ops.rows |
||
| ResetIndex datacook.engine.ops.rows |
||
| ReadOp datacook.engine.ops.sources A reader: a source op with file extensions (the format registry looks them up). |
||
| SubsetCallOp datacook.engine.ops.stats A frame method on all columns or on the `columns` subset, with a new table as result. |
||
| ValueCounts datacook.engine.ops.stats |
||
| CorrelationWith datacook.engine.ops.stats `df.corrwith(other)`: columns matched by name, rows by position (no index). |
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| Op datacook.engine.ops.base Base class for operations. Subclasses set the metadata class variables. |
⋔ Inheritance diagram¶
graph TD
3484306131["base.CallOp"]
1539482213["base.Op"]
2751680898["builtins.object"]
1539482213 --> 3484306131
2751680898 --> 1539482213
🛈 DocStrings¶
Bases: Op
An op that is one pandas call.
Either method (called on the first input, remaining inputs as leading positional
arguments: out = a.merge(b, how="left")) or function (a dotted name in the generated
code, all inputs as leading positional arguments: out = pd.read_csv("x.csv")).
Params named in positional are passed positionally; the other params are passed as
keywords when they differ from their default.
Source code in src/datacook/engine/ops/base.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | |
always
class-attribute
¶
Params passed even when they equal their default (defaults that differ from pandas).
fixed
class-attribute
¶
Keyword arguments that are not params, always passed first (e.g. axis="columns").
then
class-attribute
¶
Code appended to the call (".reset_index()"); finish() does the same in apply.
finish
classmethod
¶
literal_args
classmethod
¶
Literal positional (after skip) and keyword arguments of a call, else None.
Source code in src/datacook/engine/ops/base.py
params_from_call
classmethod
¶
params_from_call(args: list[Any], kwargs: dict[str, Any]) -> Params | None
The params of a call; None if not this op.