Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R cannot read Python Pandas dataframe saved in feather format

Tags:

python

r

feather

I have a pandas dataframe dfwin. enter image description here

And I save it to feather format hoping I can read it in R.

enter image description here

But R always throws the error "Error in openFeather(path): Invalid: Not a feather file Traceback:

  1. read_feather("./aFolder/dfwin.feather")
  2. feather(path)
  3. openFeather(path)"

Can someone help me here? The R code I used is below:

library(feather)
dfwin = read_feather('./aFolder/dfwin.feather')```
like image 992
L.Yang Avatar asked May 26 '20 03:05

L.Yang


Video Answer


1 Answers

I had exactly the same problem and I found a solution for it by using arrow package in r. the following code can be used instead of read_feather() from feather library.

arrow::read_feather("./aFolder/dfwin.feather")

I still don't understand why the function from the feather package doesn't work but the same function from arrow package can fix the issue.

like image 106
Reza Rezaei Avatar answered Sep 16 '22 13:09

Reza Rezaei