4 ms·
> DataFrames tend to gain/lose columns on every operation, so to represent them in types I'd need a zillion types with code duplication or an interface for each
by Shoue 8y ago
> DataFrames tend to gain/lose columns on every operation, so to represent them in types I'd need a zillion types with code duplication or an interface for each field name. Some operations aren't even possible to type like pivot_table.
Couldn't this be done with dependent types?
- zimablue 8y agoFor pivoting? I don't know about dependent types, sometimes it's possible in theory to know the type of the pivot columns because you know the possible combinations of column fields that you're pivoting from, but is that dependent-typable? I think there's a kind of Motte and Bailey that goes on with people who think typesystems are the one true god. They choose the simplest typesystem as their example of the cognitive/learning overhead, (say C#?) But if you question the limitations they go to "but it's possible in X obscure typesystem".
- deleted 8y ago[deleted]
- Derbasti 8y agoBut that's exactly to the OP's point: You need to think about this. You need to figure it out beforehand. In Python, you can express this without that mental overhead--particularly while prototyping.