Deedle
Deedle copied to clipboard
Rename Frame.indexRowsDate => Frame.indexRowsDateTime
@adamklein @hmansell Do you think we should do this?
(Arguably, the functions is wrong anyway, because DateTime
is not usually the right choice anyway, so we could also just remove it and make people specify the conversion explicitly.)
If we are going to have funny type-specific function names, then we their name should reflect the type.
indexRowsDateTime indexRowsDateTimeOffset
etc.
Nobody seems to like the "funny type-specific function" approach. Is there another way? What about a type hint function? Eg,
let indexRows (t:'R2 -> 'R2) column (frame:Frame<'R1, 'C>) : Frame<'R2, _> = frame.IndexRows<'R2>(column)
Then, you would write:
df |> Frame.indexRows int "intcolumn"
df |> Frame.indexRows string "stringcolumn"
Edit: well, this wouldn't work for DateTimeOffset...
Nice idea! Doing it in a way where you can re-use standard F# functions like float
as you suggest makes that approach quite nice. Let's do that!
Another option would be to fix F# :-) for which I created an issue on F# user voice.
(Changed tags to planned feature)
I upvoted your F# fix proposal :)