pandarallel icon indicating copy to clipboard operation
pandarallel copied to clipboard

Use accessor

Open datapythonista opened this issue 6 years ago • 0 comments

I think it would make things easier and more standard if you use a pandas accessor instead.

import pandas

@pandas.api.extensions.register_dataframe_accessor('parallel')
class ClassWithYourMethods:
    pass

Then, the user can use:

import pandas_parallel

df = DataFrame(some_data)

df.parallel.apply(some_function)

I think we haven't done a great job at letting users/developers know about accessors, but I think it's good for pandas users to have a unified way of using pandas "plugins". We've got in the pandas roadmap to improve the contributing documentation, hopefully that makes things easier for extension developers and users.

Doc here: http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.api.extensions.register_dataframe_accessor.html

Also, feel free to send a PR to add this package to the pandas ecosystem page if you haven't: http://pandas.pydata.org/pandas-docs/stable/ecosystem.html

datapythonista avatar Jun 07 '19 08:06 datapythonista