Sample
Base classes
| Name |
Children |
Inherits |
CallOp datacook.engine.ops.base An op that is one pandas call. |
|
|
⋔ Inheritance diagram
graph TD
3851123563["rows.Sample"]
3484306131["base.CallOp"]
1539482213["base.Op"]
2751680898["builtins.object"]
3484306131 --> 3851123563
1539482213 --> 3484306131
2751680898 --> 1539482213
🛈 DocStrings
Bases: CallOp
Source code in src/datacook/engine/ops/rows.py
| class Sample(base.CallOp):
id = "sample"
title = _("Random sample")
description = _(
"Random rows (a fixed seed keeps the result stable when the node is recomputed)."
)
category = categories.ROWS
icon = "mdi.dice-multiple-outline"
method = "sample"
class Params(base.Params):
n: int | None = Field(None, title=N_("Rows"), ge=0)
frac: float | None = Field(None, title=N_("Fraction"), ge=0)
replace: bool = Field(False, title=N_("With replacement"))
random_state: int = Field(0, title=N_("Seed"))
|
:fa-brands-github: Show source on GitHub