datawrangler.zoo.null#

datawrangler.zoo.null.is_null(data)[source]#

Test whether an object is None or empty.

Parameters

data – the to-be-tested object

Returns

True if the object is None or empty and False otherwise.

datawrangler.zoo.null.wrangle_null(data, return_model=False, model=<class 'pandas.core.frame.DataFrame'>)[source]#

Turn a null object (None or empty) into an empty DataFrame.

Parameters
  • data – the to-be-wrangled null object

  • return_model – if True, return a model (and its arguments and keyword arguments) for turning the null object into a DataFrame.

  • model

    a function or constructor that will generate an empty DataFrame. This can also be specified as a dictionary with the following fields:

    • ’model’: a function or constructor

    • ’args’: a list of unnamed arguments to be passed to the given function or constructor

    • ’kwargs’: a dictionary of named arguments to be passed to the given function or constructor

Returns

an empty DataFrame