rocketlaunchr / dataframe-go

DataFrames for Go: For statistics, machine-learning, and data manipulation/exploration
Other
1.19k stars 95 forks source link

add Head and Tail print function #6

Closed vlamai closed 5 years ago

rocketlaunchr-cto commented 6 years ago

I think the Head and Tail function of pandas does 2 things: 1) Gets a subset of data from main series 2) Prints the table to standard out.

Re 2: I believe that calling fmt is easy enough for someone to do. There doesn't need to be a new function to make that easier.

Re 1: Maybe a better option is create a new helper function similar to RangeFinite(start, end int) Range that creates the subset more easily. Alternatively, add some extra code to Range struct so that it accepts negative numbers. When negative, it knows to start from opposite end.

rocketlaunchr-cto commented 5 years ago

Head and Tail functionality has been added via RangeFinite accepting negative values and/or nil.