BPt.Dataset.drop_subjects_by_nan#

Dataset.drop_subjects_by_nan(scope='all', threshold=0.5, inplace=False)[source]#

This method is used for dropping subjects based on the amount of missing values found across a subset of columns as selected by scope. Each subject is dropped if it has greater than or equal to the passed threshold of NaN values.

Parameters
scopeScope

A BPt style Scope used to select a subset of column(s) in which to apply the current function to. See Scope for more information on how this can be applied.

default = 'all'
thresholdfloat, int, ‘all’ or ‘any’, optional

Can pass input as either a float greater than 0 and less than 1, which refers to calculating a percent of columns to drop, or as an absolute passed as an int, then it represents an absolute number of columns that a subject needs to have greater than or equal to that value in order to drop.

There are also special keywords ‘all’ and ‘any’ to drop if any missing in scope, or all in scope respectively.

So for example, pass either threshold=1, or threshold=’any’, to drop the subject if there are any NaN’s at all in scope.

default = .5
inplacebool, optional

If True, perform the current function inplace and return None.

default = False