5 ms·
How do you transfer data from Python to R? I like the look of ggplot2, but most of my data I keep as pickle files.
by dnhz 8y ago
How do you transfer data from Python to R? I like the look of ggplot2, but most of my data I keep as pickle files.
- minimaxir 8y agoExporting as a CSV (e.g. pandas's to_csv) works fine, since R/ggplot2 expects tabular data. You probably shouldn't be keeping data as pickles, for both compatibility and security reasons.
- dnhz 8y ago>You probably shouldn't be keeping data as pickles, for both compatibility and security reasons It's science research. My own simulation code and data. Some of it is hdf5, but pickle files are pretty convenient. Workflow is mainly turning data into plots. Heh, I thought I was doing alright since I'm not using textfiles.
- cwyers 8y agoFeather, based on the Apache Arrow format, is a lot faster than CSVs, and there's good support in both R and Python for it, maintained by Hadley Wickham (who has developed Almost Ever R Package You've Heard Of) and Wes McKinney (who is the BDFL of pandas) respectively. It also involves less inferring of data types using heuristics.