Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty data.frame round-tripping #411

Open
king-of-poppk opened this issue Feb 3, 2023 · 0 comments
Open

empty data.frame round-tripping #411

king-of-poppk opened this issue Feb 3, 2023 · 0 comments

Comments

@king-of-poppk
Copy link

king-of-poppk commented Feb 3, 2023

It seems there is currently no straightforward way to round-trip empty data frames. The colnames(df) are dropped since they are repeated for each row, but there are no rows! I could not find a way to make fromJSON correctly parse toJSON(df, dataframe = "columns"), and anyway the output is also empty when the input data frame has no rows.

I guess one has to extract header, index, and values manually and do some custom JSON encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant