rocketlaunchr / dataframe-go

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

Expand docs to include other common dataframe operations, etc. #40

Closed khughitt closed 4 years ago

khughitt commented 4 years ago

Greetings!

Just a minor suggestion, but if you have the time, it could be useful to expand the docs a bit more to cover some additional common operations applied to dataframe-like structures, where supported.

For example:

Further, one other thing I noticed when employing the package for the first time, is that many of the dataframe.xx() function calls include a nil as the first argument.

From looking at the code for dataframe.go, these appear to be relating to an optional Options struct, so it makes sense that this would be set to nil in many instances. It may just be worth mentioning this explicitly in the examples for .Append() in the docs.

Finally two other things that could be useful to consider including in the docs:

Thanks for taking the time to put together and share this really useful package!

pjebs commented 4 years ago

I am reluctant to add more content to the readme because it is already too big. I want to readme to be nothing more than a general introduction.

The plan is:

  1. Create a comprehensive website based manual (not a wiki page) using Hugo.
  2. Truncate the readme significantly.

When I get some time I will do it.

I was hoping that using the godocs, people would eventually work out how to do the tasks you mentioned such as: retrieve single row, retrieve a single column etc - even if it takes 5 minutes instead of 30 seconds.

khughitt commented 4 years ago

That's fair.

I agree that re-purposing the README.md as a manual is probably not ideal, so a separate Hugo-based manual sounds great.

That is also understandable regarding uisng godocs. The only reason is took longer really is because I'm still fairly new to Go programming in general, but even then, I was still able to figure most things out on my own with a little effort. I suspect other users with a bit more experience would have even less trouble.

Thanks for taking the time to respond and share your plans!

Feel free to close this issue, unless you want to use is to track progress on the manual front.

pjebs commented 4 years ago

Do you want to write the manual (under my guidance)?

khughitt commented 4 years ago

Realistically, I probably won't have the time to..

If you want though, perhaps you could create an outline for what you have in mind as far as the manual, and just hold off making it public / keep it in a separate branch initially.

Then, as I'm working through different things I can try and help fill in sections of it.

khughitt commented 4 years ago

Quick question -- how do you retrieve the values for a single column in a dataframe, given the column name?

I tried to figure it out from the code for DataFrame and Series, but have not had any luck..

pjebs commented 4 years ago

https://godoc.org/github.com/rocketlaunchr/dataframe-go#DataFrame.NameToColumn https://godoc.org/github.com/rocketlaunchr/dataframe-go#DataFrame df.Series[idx] will return the Series.

pjebs commented 4 years ago

If the series is a SeriesFloat64, you can then use the .Values field to get an []float64 of all the values. But otherwise you need to iterate to obtain the values.

khughitt commented 4 years ago

Ah got it. I had tries using df.Series[df.NameToColumn("foo")].Values, but this was for a SeriesInt64 column, so it wasn't working.

Thanks for the quick response and suggestions!

pjebs commented 4 years ago

Nametocolumn returns 2 values. So you can't inline.

You can use MustNameToColumn instead

khughitt commented 4 years ago

Yep. I realized that shortly after posting. Haven't tried MustNameToColumn though.. I'll check it out. Thanks for the tip!

On the topic of documentation, one more thing that could be useful to consider including (probably in the README, and not the manual) would be a quick overview with what you see as the strengths (and limitations) of dataframe-go vs.

  1. qframe, and,
  2. gota.