Deedle icon indicating copy to clipboard operation
Deedle copied to clipboard

Rename Frame.indexRowsDate => Frame.indexRowsDateTime

Open dshiber opened this issue 11 years ago • 6 comments

dshiber avatar Nov 21 '13 13:11 dshiber

@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.)

tpetricek avatar May 22 '14 00:05 tpetricek

If we are going to have funny type-specific function names, then we their name should reflect the type.

indexRowsDateTime indexRowsDateTimeOffset

etc.

hmansell avatar May 22 '14 19:05 hmansell

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...

adamklein avatar May 28 '14 14:05 adamklein

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.

tpetricek avatar May 28 '14 14:05 tpetricek

(Changed tags to planned feature)

tpetricek avatar May 28 '14 14:05 tpetricek

I upvoted your F# fix proposal :)

adamklein avatar May 28 '14 14:05 adamklein