Open nikhilwoodruff opened 3 years ago
Hey @nikhilwoodruff, I've been passively lurking in the Github notifications for this project and have enjoyed seeing the progress y'all are making!
I did something kinda similar in Tax-Calculator a few months ago if it's helpful: https://github.com/hdoupe/Tax-Calculator/blob/df-based/taxcalc/data.py#L313-L342
Although judging from the work you've done already, you don't need my help haha.
Thanks @hdoupe, that tax-calc example is pretty cool, and interesting that it uses setattr too. Not sure if there's any Pandas uses for setattr we need to cover @MaxGhenis?
pandas lets you overwrite an existing value with setattr, but only if the column already exists:
import pandas as pd
df = pd.DataFrame({"x": [1]})
df.x = 2
df
yields:
x
0 2
Where:
df.y = 2
df
still yields:
x
0 2
This would allow:
Currently, we can only do:
We just would need to add a getattr override to MicroDataFrame, call the super function and wrap the results in the same MicroDataFrame configuration that it's called from.