Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Don't put methods on it like pandas.DataFrame. You won't get the API right the first many times and you'll end up with a million methods.

I was actually thinking about this for a bit. Since the data layout seems unlikely to ever backwards-incompatibly change, can you not define the API entirely in traits on the struct, and package them into one super trait (e.g. DataFrameAPIVersion1)?

Then you can simply import the DataFrame struct as well as the version of the API you'll use, and be 100% compatible with any other code regardless of API version they use to manipulate the dataframes.



Then application-specific functions would need a different syntax from the built in methods. Like df.pipe(f). I think that is not desirable. Better to have them all be detached from the frame


That's not true. You can implement your own traits for foreign types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: