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
- param x:
a numeric scalar or Array
- param a:
lower bound– a numeric scalar or an Array of the same shape as x
- param b:
upper bound– a numeric scalar or an Array of the same shape as x
Returns
- return:
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
- param x:
an array-like object
Returns
- return:
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
- param x:
the object
- param 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
- return:
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
- param x:
the object
- param debug:
internal flag (default: False) that prints out why an object is not dataframe like
Returns
- return:
True (if the object can be treated like a DataFrame) or False otherwise