redflag
redflag copied to clipboard
Accessor for `pd.DataFrame`
Could be interesting to implement detectors etc as methods on DataFrames, eg
df = pd.read_csv('my_data.csv')
df.rf.find_outliers()
How-to: https://pandas.pydata.org/docs/development/extending.html
Could do the same for xarrays I guess, but DataFrames are key.
API like:
df.redflag.cool_method(X=None, y=None, **kwargs)
E.g.
features = ['GR', 'RHOB', 'PE'] # Columns in df.
df.redflag.cool_method(X=features, y='Lithology') # y can also be a list.
Then...
- If
XandyareNone, treat the wholedfasX - If only
XisNone, useyand treat the remaining columns asX - If only
yisNone, useXand ignorey