neuralib.tracking.deeplabcut.core.DeepLabCutDataFrame
- class neuralib.tracking.deeplabcut.core.DeepLabCutDataFrame[source]
Bases:
DataFrameWrapperDeepLabCut DataFrame
┌───────────┬───────────┬───────────┬───────────┬───┬───────────┬───────────┬───────────┬──────────┐ │ Nose_x ┆ Nose_y ┆ Nose_like ┆ EarL_x ┆ … ┆ TailMid_l ┆ TailEnd_x ┆ TailEnd_y ┆ TailEnd_ │ │ --- ┆ --- ┆ lihood ┆ --- ┆ ┆ ikelihood ┆ --- ┆ --- ┆ likeliho │ │ f64 ┆ f64 ┆ --- ┆ f64 ┆ ┆ --- ┆ f64 ┆ f64 ┆ od │ │ ┆ ┆ f64 ┆ ┆ ┆ f64 ┆ ┆ ┆ --- │ │ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ f64 │ ╞═══════════╪═══════════╪═══════════╪═══════════╪═══╪═══════════╪═══════════╪═══════════╪══════════╡ │ 57.907318 ┆ 512.54742 ┆ 0.999679 ┆ 77.701355 ┆ … ┆ 0.999904 ┆ 257.71426 ┆ 561.89660 ┆ 0.999961 │ │ ┆ 4 ┆ ┆ ┆ ┆ ┆ 4 ┆ 6 ┆ │ │ 57.907318 ┆ 516.79528 ┆ 0.999688 ┆ 77.701355 ┆ … ┆ 0.999923 ┆ 257.71426 ┆ 562.05725 ┆ 0.999954 │ │ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │ │ 94.259621 ┆ 43.849434 ┆ 0.973851 ┆ 106.33532 ┆ … ┆ 0.998977 ┆ 87.477776 ┆ 257.11996 ┆ 0.999937 │ │ 94.294357 ┆ 44.340511 ┆ 0.965436 ┆ 106.45220 ┆ … ┆ 0.999604 ┆ 87.223534 ┆ 258.46600 ┆ 0.999912 │ └───────────┴───────────┴───────────┴───────────┴───┴───────────┴───────────┴───────────┴──────────┘
- __init__(df, meta, *, filtered)[source]
- Parameters:
df (DataFrame) – DeepLabCut result dataframe
meta (DeepLabCutMeta | None) –
DeepLabCutMetafiltered (bool) – whether the results has already been filtered
Methods
__init__(df, meta, *, filtered)clear([n])See polars.DataFrame.clear.
clone()Clone the wrapper.
dataframe([dataframe, may_inplace])Getter/setter for the internal Polars DataFrame.
drop(*columns[, strict])See polars.DataFrame.drop.
drop_nulls(subset)See polars.DataFrame.drop_nulls.
fill_nan([value])See polars.DataFrame.fill_nan.
fill_null([value, strategy, limit])See polars.DataFrame.fill_null.
filter(*predicates, **constraints)See polars.DataFrame.filter.
get_joint(joint)get specific joint
group_by(*by[, maintain_order])See polars.DataFrame.group_by.
head([n])See polars.DataFrame.head.
join(other, on, *args, **kwargs)See polars.DataFrame.join.
lazy()Wrap dataframe in a lazy wrapper.
limit([n])See polars.DataFrame.limit.
partition_by(by, *more_by[, as_dict])See polars.DataFrame.partition_by.
pipe(function, *args, **kwargs)See polars.DataFrame.pipe.
rename(mapping)See polars.DataFrame.rename.
select(*exprs, **named_exprs)See polars.DataFrame.select.
slice(offset[, length])See polars.DataFrame.slice.
sort(by, *more_by, **kwargs)See polars.DataFrame.sort.
tail([n])See polars.DataFrame.tail.
with_columns(*exprs, **named_exprs)See polars.DataFrame.with_columns.
with_row_index([name, offset])See polars.DataFrame.with_row_index.
Attributes
See polars.DataFrame.columns.
whether default filtered when running the deeplabcut
frame per second, meta data required
list of labelled joints
DeepLabCutMetaDeepLabCutModelConfignumber of frames
See polars.DataFrame.schema.
- __init__(df, meta, *, filtered)[source]
- Parameters:
df (DataFrame) – DeepLabCut result dataframe
meta (DeepLabCutMeta | None) –
DeepLabCutMetafiltered (bool) – whether the results has already been filtered
- dataframe(dataframe=None, may_inplace=True)[source]
Getter/setter for the internal Polars DataFrame.
- Parameters:
dataframe (DataFrame | None) – Optional new dataframe to set.
may_inplace – If True, update current instance. Otherwise, return new instance.
- Returns:
The current dataframe or a modified wrapper instance.
- property default_filtered: bool
whether default filtered when running the deeplabcut
- property meta: DeepLabCutMeta
DeepLabCutMeta
- property model_config: DeepLabCutModelConfig
DeepLabCutModelConfig
- property fps: float
frame per second, meta data required
- property nframes: int
number of frames
- property joints: list[str]
list of labelled joints
- clear(n=5)
See polars.DataFrame.clear.
- Parameters:
n (int)
- Return type:
Self
- clone()
Clone the wrapper.
- Return type:
Self
- property columns: list[str]
See polars.DataFrame.columns.
- drop(*columns, strict=True)
See polars.DataFrame.drop.
- Parameters:
columns (pty.ColumnNameOrSelector | Iterable[pty.ColumnNameOrSelector])
strict (bool)
- Return type:
Self
- drop_nulls(subset)
See polars.DataFrame.drop_nulls.
- Parameters:
subset (pty.ColumnNameOrSelector | Collection[pty.ColumnNameOrSelector])
- Return type:
Self
- fill_nan(value=None)
See polars.DataFrame.fill_nan.
- Parameters:
value (pl.Expr | int | float | None)
- Return type:
Self
- fill_null(value=None, strategy=None, limit=None, **kwargs)
See polars.DataFrame.fill_null.
- Parameters:
value (Any | pl.Expr | None)
strategy (pty.FillNullStrategy | None)
limit (int | None)
- Return type:
Self
- filter(*predicates, **constraints)
See polars.DataFrame.filter.
- Parameters:
predicates (pty.IntoExprColumn | Iterable[pty.IntoExprColumn] | bool | list[bool] | np.ndarray)
constraints (Any)
- Return type:
Self
- group_by(*by, maintain_order=False, **named_by)
See polars.DataFrame.group_by.
- Parameters:
by (pty.IntoExpr | Iterable[pty.IntoExpr])
maintain_order (bool)
named_by (pty.IntoExpr)
- Return type:
GroupBy
- head(n=5)
See polars.DataFrame.head.
- Parameters:
n (int)
- Return type:
Self
- join(other, on, *args, **kwargs)
See polars.DataFrame.join.
- Parameters:
other (pl.DataFrame | DataFrameWrapper)
- Return type:
Self
- lazy()
Wrap dataframe in a lazy wrapper.
- Return type:
LazyDataFrameWrapper[Self]
- limit(n=5)
See polars.DataFrame.limit.
- Parameters:
n (int)
- Return type:
Self
- partition_by(by, *more_by, as_dict=False, **kwargs)
See polars.DataFrame.partition_by.
- pipe(function, *args, **kwargs)
See polars.DataFrame.pipe.
- Parameters:
function (Callable[Concatenate[pl.DataFrame, P], pl.DataFrame])
args (P.args)
kwargs (P.kwargs)
- Return type:
Self
- rename(mapping)
See polars.DataFrame.rename.
- Parameters:
mapping (dict[str, str] | Callable[[str], str])
- Return type:
Self
- property schema: Schema
See polars.DataFrame.schema.
- select(*exprs, **named_exprs)
See polars.DataFrame.select.
- Parameters:
exprs (pty.IntoExpr | Iterable[pty.IntoExpr])
named_exprs (pty.IntoExpr)
- Return type:
Self
- slice(offset, length=None)
See polars.DataFrame.slice.
- Parameters:
offset (int)
length (int | None)
- Return type:
Self
- sort(by, *more_by, **kwargs)
See polars.DataFrame.sort.
- Return type:
Self
- tail(n=5)
See polars.DataFrame.tail.
- Parameters:
n (int)
- Return type:
Self
- with_columns(*exprs, **named_exprs)
See polars.DataFrame.with_columns.
- Parameters:
exprs (pty.IntoExpr | Iterable[pty.IntoExpr])
named_exprs (pty.IntoExpr)
- Return type:
Self
- with_row_index(name='index', offset=0)
See polars.DataFrame.with_row_index.
- Parameters:
name (str)
offset (int)
- Return type:
Self