Unable to write my dataframe using feather (strided data not supported)
Asked Answered
E

1

8

When using the feather package (http://blog.cloudera.com/blog/2016/03/feather-a-fast-on-disk-format-for-data-frames-for-r-and-python-powered-by-apache-arrow/) to try and write a simple 20x20 dataframe, I keep getting an error stating that strided data isn't yet supported. I don't believe my data is strided (or out of the ordinary), and I can replicate the sample code given on the website, but can't seem to get it to work with my own. Here is some sample code:

import feather
import numpy as np
import pandas as pd

tempArr = reshape(np.arange(400), (20,20))
df = pd.DataFrame(tempArr)
feather.write_dataframe(df, 'test.feather')

The last line returns the following error:

FeatherError: Invalid: no support for strided data yet

I am running this on Ubuntu 14.04. Am I perhaps misunderstanding something about how pandas dataframes are stored?

Emlynn answered 4/4, 2016 at 16:7 Comment(2)
reshape generate a view, it can be a pb. try tempArr=tempArr.copy() before.Ferdinandferdinanda
@B.M. thanks for the suggestion! Just added that line right in between creating tempArr and creating the DataFrame, but still getting the same error.Emlynn
G
5

Please come to GitHub: https://github.com/wesm/feather/issues/97

Bug reports do not belong on StackOverflow

Gasket answered 4/4, 2016 at 18:10 Comment(1)
In essence, as explained in the link, the issue can be solved by doing df = df.copy() before writing df to a feather file.Corrales

© 2022 - 2024 — McMap. All rights reserved.