python to R compatibility in feather with strings -
i hitting error when reading feather object r put out python session.
in python:
in [248]: import pandas pd in [249]: pd.dataframe({'col': ['a','b','c']}).to_feather('strings_df.feather')
in r:
> library(feather) > df = read_feather('strings_df.feather') error in coldatafeather(x, i) : raw() can applied 'raw', not 'list'
is related fact strings stored objects in pandas.series
? any thoughts on what's happening here?
session info:
r
r version 3.3.1 (2016-06-21) platform: x86_64-apple-darwin13.4.0 (64-bit) running under: os x 10.10.5 (yosemite)
locale: [1] en_us.utf-8/en_us.utf-8/en_us.utf-8/c/en_us.utf-8/en_us.utf-8
attached base packages: [1] stats graphics grdevices utils
datasets methods baseother attached packages: [1] feather_0.3.0
loaded via namespace (and not attached): [1] assertthat_0.1 hms_0.2 tools_3.3.1 tibble_1.2 rcpp_0.12.5
python
'2.7.10 (default, jul 3 2015, 12:05:53) \n[gcc 4.2.1 compatible apple llvm 6.1.0 (clang-602.0.53)]'
pandas version: '0.20.3'
numpy version: '1.13.1'
the issue values in string column should of type unicode
, not str
. following works expected:
pd.dataframe({'col': [u'a',u'b',u'c']}).to_feather('strings_df.feather')
Comments
Post a Comment