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

i use pure functions wherever i can, but is this always the right approach when dealing with large dataframes? i imagine when you're chaining a few methods, it'd generate a large number of intermediate results that immediately get discarded/transformed again:

  frame.foo_columns().bar_rows().baz()
the result of .foo_columns() is basically linear – it gets passed to .bar_rows() immediately, with no other references to it. maybe this'd be a good place for rust's safe mutability magic?


If each of those methods consumes `self` instead of taking a reference to it, then the methods are effectively pure, and don't require copying.


yeah, that's what i meant by "linear" (as in linear types, similar to rust's ownership stuff, just terminology i'm more familiar with)




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

Search: