datawrangler.util#
- datawrangler.util.btwn(x, a, b)[source]#
Test whether the values of an array (or scalar) are between the given bounds (inclusive)
- Parameters
x – a numeric scalar or Array
a – lower bound– a numeric scalar or an Array of the same shape as x
b – upper bound– a numeric scalar or an Array of the same shape as x
- Returns
True if the values in the given Array are between the given bounds (inclusive), and False otherwise.
- datawrangler.util.depth(x)[source]#
Determine the maximum depth of a list or array (i.e., maximum amount of nesting, across all elements)
- Parameters
x – an array-like object
- Returns
The depth of the object
- datawrangler.util.array_like(x, force_literal=False)[source]#
Determine whether an object can be treated as a Numpy Array for wrangling purposes
- Parameters
x – the object
force_literal – specify whether strings should be interpreted strictly (if force_literal == True) or whether they may refer to files or URLs (if force_literal == False). Default: False
- Returns
True (if the object can be treated like an Array) or False otherwise
- datawrangler.util.dataframe_like(x, debug=False)[source]#
Determine whether an object can be treated as a Pandas DataFrame for wrangling purposes
- Parameters
x – the object
debug – internal flag (default: False) that prints out why an object is not dataframe like
- Returns
True (if the object can be treated like a DataFrame) or False otherwise