macpie.MacDataFrameAccessor#

class macpie.MacDataFrameAccessor(df)#

Custom DataFrame accessor to extend the pandas.DataFrame object. This creates an additional namepace on the DataFrame object called mac.

The majority of methods exposed via this accessor are derived from functions already available from the public API. This is essentially syntactic sugar for calling those functions (leaving out the first argument, as that is the DataFrame object using the accessor).

Examples

>>> from datetime import datetime
>>> import pandas as pd
>>> import macpie as mp
>>> df = pd.DataFrame({'numeric_col': [1], 'date_col': [datetime(2001, 3, 2)]})
>>> df.mac.is_date_col('numeric_col')
False
>>> df.mac.is_date_col('date_col')
True
>>> mp.pandas.is_date_col(df, 'date_col')
True
__init__(df)#

Methods

__init__(df)

col_count()

row_count()

Attributes

accessor_api