Comments (6)
Should add that converting the column from np.int64 to np.int32 fixed the problem. Then it saved just fine.
from feather.
Can you let me know some more detail about your platform? The issue is that depending on your platform, NPY_INT64
may be either NPY_LONG
or NPY_LONGLONG
, and there may be code which sets NPY_LONGLONG
(type=9) in spite of this. Easy to fix, but I'll have to look into a way to reproduce the error in a test case
from feather.
I'm using a 2015 retina MacBookPro with OS X 10.11. Thanks for looking into it.
from feather.
For what it's worth I got the same error when trying to save the following DataFrame. I have exactly the same OSX as dan-tee. Changing the columns to 'np.int32' also worked.
Data columns (total 5 columns):
Name Changed 433 non-null object
Name Changed 433 non-null int64
Name Changed 433 non-null int64
Name Changed 433 non-null int64
Name Changed 433 non-null int64
dtypes: int64(4), object(1)
memory usage: 20.3+ KB
FeatherError Traceback (most recent call last)
<ipython-input-716-c3919d5846a7> in <module>()
2
3 path = 'headcount.feather'
----> 4 feather.write_dataframe(Headcount, path)
/Users/Davies/anaconda/lib/python2.7/site-packages/feather/api.pyc in write_dataframe(df, path)
33 name = str(name)
34
---> 35 writer.write_array(name, col)
36
37 writer.close()
/Users/Davies/anaconda/lib/python2.7/site-packages/feather/ext.pyx in feather.ext.FeatherWriter.write_array (feather/ext.cpp:2130)()
86 self.write_timestamp(name, col, mask)
87 else:
---> 88 self.write_primitive(name, col, mask)
89
90 cdef write_category(self, name, col, mask):
/Users/Davies/anaconda/lib/python2.7/site-packages/feather/ext.pyx in feather.ext.FeatherWriter.write_primitive (feather/ext.cpp:2435)()
108
109 col_values = _unbox_series(col)
--> 110 self.write_ndarray(col_values, mask, &values)
111 check_status(self.writer.get().AppendPlain(c_name, values))
112
/Users/Davies/anaconda/lib/python2.7/site-packages/feather/ext.pyx in feather.ext.FeatherWriter.write_ndarray (feather/ext.cpp:2742)()
133 cdef int write_ndarray(self, values, mask, PrimitiveArray* out) except -1:
134 if mask is None:
--> 135 check_status(pandas_to_primitive(values, out))
136 else:
137 check_status(pandas_masked_to_primitive(values, mask, out))
/Users/Davies/anaconda/lib/python2.7/site-packages/feather/ext.pyx in feather.ext.check_status (feather/ext.cpp:1546)()
52
53 cdef string c_message = status.ToString()
---> 54 raise FeatherError(frombytes(c_message))
55
56 set_numpy_nan(np.nan)
FeatherError: Invalid: unsupported type 9
from feather.
I was able to reproduce the issue and fix it. Will push out a new PyPI release as soon as the Travis build finishes
from feather.
Thanks. I'm using feather multiple times a day now. Really grateful for it!
from feather.
Related Issues (20)
- Incompatibility with tibble>=2.0.0 HOT 4
- Read file in "feather" format by command "View" HOT 2
- Disable test for UTF-8 filenames on windows
- Reading/writing fails for large data.frames HOT 5
- Support for set/list columns in python HOT 2
- "cannot serialize duplicate column names" HOT 2
- Is it possible to save feather file in compressed zip format? HOT 6
- Should feather::read_feather respect options(stringsAsFactors = FALSE)? HOT 3
- In R, Feather cannot read dataframe back if missing or having empty column header HOT 2
- [Feature request] allow datetime index HOT 3
- python feather-format 0.4.0 is incompatible with pyarrow 0.17.0: ImportError FeatherError FeatherReader FeatherWriter HOT 3
- feather installation failed with "big endian" issue HOT 3
- Reading feather HOT 1
- Another CRAN release needed: not compatible with arrow HOT 2
- where are the docs? HOT 1
- Strange error HOT 1
- how to inspect metadata?
- pyarrow.lib.ArrowTypeError: Expected bytes, got a 'dict' object
- Support for Big-endian?
- how can I write file as a+ mode?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feather.