Документация Engee

Filtering

Страница в процессе перевода.

Impute.filter([f,] data; dims)

Filters values, rows, columns or slices of data that should be removed. The default function f will removing missings, or any rows, columns or slices containing missings.

Examples

julia> using DataFrames; using Impute: Impute



julia> df = DataFrame(:a => [1.0, 2.0, missing, missing, 5.0], :b => [1.1, 2.2, 3.3, missing, 5.5])
5×2 DataFrame
 Row │ a          b
     │ Float64?   Float64?
─────┼──────────────────────
   1 │       1.0        1.1
   2 │       2.0        2.2
   3 │ missing          3.3
   4 │ missing    missing
   5 │       5.0        5.5

julia> Impute.filter(df; dims=:cols)
0×0 DataFrame

julia> Impute.filter(df; dims=:rows)
3×2 DataFrame
 Row │ a        b
     │ Float64  Float64
─────┼──────────────────
   1 │     1.0      1.1
   2 │     2.0      2.2
   3 │     5.0      5.5
Filter([f])

Uses a function f to identify values, rows, columns or slices of data that should be removed during an apply call. The default function f will removing missings, or any rows, columns or slices containing missings.