pyjanitor-devs / pandas_flavor

The easy way to write your own flavor of Pandas
https://zsailer.github.io/software/pandas-flavor/
MIT License
301 stars 17 forks source link

support xarray #15

Closed eyaltra closed 5 years ago

eyaltra commented 5 years ago

Support xarray in the same way done in pyjanitor PR

Example of a small run for validating Regression + New stuff:

import pandas as pd

import pandas_flavor as pf

@pf.register_dataframe_method @pf.register_xarray_dataarray_method @pf.register_xarray_dataset_method def print_df(df): print(df) return df

df = pd.DataFrame(data={"x": [10, 20, 25], "y": [0, 2, 5]}) df.print_df() df.to_xarray().print_df()

Zsailer commented 5 years ago

Looks great. Happy to merge as-is.

I need to add some tests to pandas-flavor (in general, not just for this PR) before cutting a release. I'll try to work on that tomorrow and cut a release ASAP.