def _in_box(x, boxlim):
    '\n\n    returns the a boolean index indicated which data points are inside\n    and which are outside of the given box_lims\n\n    Parameters\n    ----------\n    x : pd.DataFrame\n    boxlim : pd.DataFrame\n\n    Returns\n    -------\n    ndarray\n        boolean 1D array\n\n    Raises\n    ------\n    Attribute error if not numbered columns are not pandas\n    category dtype\n\n    '
    x_numbered = x.select_dtypes(np.number)
    boxlim_numbered = boxlim.select_dtypes(np.number)
    logical = ((boxlim_numbered.loc[0, :].values <= x_numbered.values) & (x_numbered.values <= boxlim_numbered.loc[1, :].values))
    logical = logical.all(axis=1)
    for (column, values) in x.select_dtypes(exclude=np.number).iteritems():
        entries = boxlim.loc[(0, column)]
        not_present = (set(values.cat.categories.values) - entries)
        if not_present:
            l = pd.isnull(x[column].cat.remove_categories(list(entries)))
            logical = (l & logical)
    return logical
returns the a boolean index indicated which data points are inside
and which are outside of the given box_lims

Parameters
----------
x : pd.DataFrame
boxlim : pd.DataFrame

Returns
-------
ndarray
    boolean 1D array

Raises
------
Attribute error if not numbered columns are not pandas
category dtype
def _in_box(x, boxlim):
    '\n\n    returns the a boolean index indicated which data points are inside\n    and which are outside of the given box_lims\n\n    Parameters\n    ----------\n    x : pd.DataFrame\n    boxlim : pd.DataFrame\n\n    Returns\n    -------\n    ndarray\n        boolean 1D array\n\n    Raises\n    ------\n    Attribute error if not numbered columns are not pandas\n    category dtype\n\n    '
    x_numbered = x.select_dtypes(np.number)
    boxlim_numbered = boxlim.select_dtypes(np.number)
    logical = ((boxlim_numbered.loc[0, :].values <= x_numbered.values) & (x_numbered.values <= boxlim_numbered.loc[1, :].values))
    logical = logical.all(axis=1)
    for (column, values) in x.select_dtypes(exclude=np.number).iteritems():
        entries = boxlim.loc[(0, column)]
        not_present = (set(values.cat.categories.values) - entries)
        if not_present:
            l = pd.isnull(x[column].cat.remove_categories(list(entries)))
            logical = (l & logical)
    return logical