4 ms·
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'
by uryga 7y ago
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?
- wtetzner 7y agoIf each of those methods consumes `self` instead of taking a reference to it, then the methods are effectively pure, and don't require copying.
- uryga 7y agoyeah, that's what i meant by "linear" (as in linear types, similar to rust's ownership stuff, just terminology i'm more familiar with)