dalejung / pandas-composition

Pandas Composition/Inheritance
MIT License
9 stars 0 forks source link

demo: Logging DataFrame #16

Open dalejung opened 11 years ago

dalejung commented 11 years ago

Create a dataframe that doesn't execute commands but rather logs.

The core python operators would be tracked via the overridden magic methods.

df + 1 would use __add__.

as far as I can tell, the biggest parts after that are things like pd.rolling_moments and np.isnan

It'd be possible to create a np equivalent that requests operators of the dataframe. I suppose the same could be said of pd.rolling_sum.

I thought of maybe doing this via __array_prepare__ but that was a dead end. I can't stop the calculation and can't expect that every ufunc has a context object.