When read rds
file in python following way:
import pyreadr
df = prreadr.read_r('/home/test.rds')
to turn df
into DataFrame
, I tried:
pd.DataFrame(df)
- I get If using all scalar values, you must pass an index
message
pd.DataFrame(df, columns = ['a','b','c'])
- I get columns with NaN
pd.DataFrame.from_dict(df, orient = 'index', columns = ['a','b','c'])
- I get Shape of passed values is (1, 1), indices imply (1, 11)
message
I want to read rds
file in Python and turn it into DataFrame
.