Nice to have toMap
function in DataFrame
#86
Comments
Thanks for the sharing. You could define an extension function to support this:
Clearly krangl's API needs to be extended to cover more use-cases, but unless you could elaborate more on the specific usecase, I'd think that such extension does not need to be part of the core API. |
Here is my use-case: https://github.com/JetBrains/lets-plot-kotlin/blob/master/docs/examples/jupyter-notebooks/geom_smooth.ipynb I read CSV file to krangl DataFrame and then have to convert it to a regular Map to pass to Lets-Plot as data parameter. The most reasonable place to put the |
Great examples. I took the liberty to disable the |
My understanding was that no-name column was the index. As map doesn't have index I've dropped it. |
There is no equivalent to pandas indices in krangl. I personally found the index concept always confusing compared to dplyr which works great (if not better) without confronting the user with a similar index-concept. So in krangl, we enforce unqique columns already (following dplyr's lead), but we currently support an empty string as column name. However, I can't imagine any usecase for such a feature, so I'd be more in favor of enforcing not-null not-empty column names. |
Btw, how did you write https://jetbrains.bintray.com/lets-plot/mpg.csv ? I've noticed that the latest version of the used csv parsing library commons-csv can not handle it because of https://issues.apache.org/jira/browse/CSV-257 and I'd like to comment on it by pointing to your example file. |
I really couldn't recall now. Please feel free to point at it. I believe we've checked the license before using it. |
This code works for me:
but would be nice to just use:
The text was updated successfully, but these errors were encountered: