Module ImportFrom alias alias alias Import alias identifier ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp NameLoad comprehension TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareEq NameLoad Str If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad Assign NameStore ListComp Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad keyword Call NameLoad Call NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str orelse Assign NameStore AttributeLoad NameLoad attr If Call NameLoad NameLoad AttributeLoad NameLoad attr body If CompareIn AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad orelse Return NameLoad orelse Return Call AttributeLoad NameLoad attr Call NameLoad GeneratorExp TupleLoad NameLoad IfExp CompareIn NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad NameLoad Index NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr comprehension NameStore AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call NameLoad GeneratorExp TupleLoad NameLoad IfExp Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad AttributeLoad AttributeLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr attr attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr comprehension NameStore AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword IfExp Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad AttributeLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr attr comprehension NameStore AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list
N/A __future__ absolute_import division print_function N/A pandas pd toolz partial dask.base compute _categorize_block N/A N/A df categories N/A N/A N/A  Categorize a dataframe with given categories

    df: DataFrame
    categories: dict mapping column name to iterable of categories
     N/A df N/A N/A df copy N/A N/A col vals N/A N/A categories items N/A N/A N/A df N/A col N/A N/A pd Categorical N/A df N/A col categories vals ordered False N/A df N/A categorize N/A N/A df columns N/A None kwargs N/A N/A 
    Convert columns of dataframe to category dtype

    This aids performance, both in-memory and in spilling to disk
     N/A N/A columns None N/A N/A dtypes N/A df dtypes N/A columns N/A name N/A N/A name dt N/A zip N/A dtypes index N/A dtypes values N/A dt O N/A N/A N/A isinstance columns N/A list tuple N/A N/A columns N/A columns N/A distincts N/A N/A N/A N/A df N/A col drop_duplicates N/A col columns N/A values N/A compute distincts kwargs N/A func N/A partial _categorize_block categories N/A dict N/A zip columns values N/A N/A N/A df map_partitions func columns N/A df columns N/A _categorize N/A N/A categories df N/A N/A N/A  Categorize columns in dataframe

    >>> df = pd.DataFrame({'x': [1, 2, 3], 'y': [0, 2, 0]})
    >>> categories = {'y': ['A', 'B', 'c']}
    >>> _categorize(categories, df)
       x  y
    0  1  A
    1  2  c
    2  3  A

    >>> _categorize(categories, df.y)
    0    A
    1    c
    2    A
    dtype: category
    Categories (3, object): [A, B, c]
     N/A N/A .index categories N/A N/A index N/A N/A pd CategoricalIndex N/A N/A N/A pd Categorical from_codes N/A N/A df index values N/A categories N/A .index N/A N/A index N/A df index N/A N/A isinstance df N/A pd Series N/A N/A N/A N/A df name categories N/A N/A cat N/A N/A N/A pd Categorical from_codes N/A df values N/A categories N/A N/A df name N/A N/A N/A pd Series cat index index N/A N/A df N/A N/A N/A N/A pd DataFrame N/A dict N/A N/A col N/A N/A col categories N/A N/A N/A pd Categorical from_codes N/A N/A df N/A col values N/A categories N/A col N/A N/A df N/A col values N/A col N/A df columns columns N/A df columns index index N/A strip_categories N/A N/A df N/A N/A N/A  Strip categories from dataframe

    >>> df = pd.DataFrame({'x': [1, 2, 3], 'y': ['A', 'B', 'A']})
    >>> df['y'] = df.y.astype('category')
    >>> strip_categories(df)
       x  y
    0  1  0
    1  2  1
    2  3  0
     N/A N/A N/A pd DataFrame N/A dict N/A N/A col N/A N/A iscategorical N/A N/A df dtypes N/A col N/A N/A N/A N/A df N/A col cat codes values N/A N/A df N/A col values N/A col N/A df columns columns N/A df columns index N/A N/A iscategorical N/A N/A df index dtype N/A N/A df index codes N/A df index N/A iscategorical N/A N/A dt N/A N/A N/A N/A isinstance dt N/A N/A N/A pd core common CategoricalDtype N/A get_categories N/A N/A df N/A N/A N/A 
    Get Categories of dataframe

    >>> df = pd.DataFrame({'x': [1, 2, 3], 'y': ['A', 'B', 'A']})
    >>> df['y'] = df.y.astype('category')
    >>> get_categories(df)
    {'y': Index([u'A', u'B'], dtype='object')}
     N/A result N/A dict N/A N/A col N/A N/A N/A df N/A col cat categories N/A col N/A df columns N/A iscategorical N/A N/A df dtypes N/A col N/A N/A iscategorical N/A N/A df index dtype N/A N/A N/A result N/A .index N/A N/A df index categories N/A result N/A