question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when writing: strided data not supported

See original GitHub issue

In python, when I try and write a simple 20x20 dataframe to disk, 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 without errors, 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')

And I get the following error output:

Traceback (most recent call last):

  File "<ipython-input-10-85be0b956a3f>", line 1, in <module>
    feather.write_dataframe(testDF, 'test.feather')

  File "/usr/local/lib/python2.7/dist-packages/feather/api.py", line 37, in write_dataframe
    writer.write_array(name, col)

  File "feather/ext.pyx", line 88, in feather.ext.FeatherWriter.write_array (feather/ext.cpp:2127)
    self.write_primitive(name, col, mask)

  File "feather/ext.pyx", line 110, in feather.ext.FeatherWriter.write_primitive (feather/ext.cpp:2432)
    self.write_ndarray(col_values, mask, &values)

  File "feather/ext.pyx", line 135, in feather.ext.FeatherWriter.write_ndarray (feather/ext.cpp:2739)
    check_status(pandas_to_primitive(values, out))

  File "feather/ext.pyx", line 54, in feather.ext.check_status (feather/ext.cpp:1543)
    raise FeatherError(frombytes(c_message))

FeatherError: Invalid: no support for strided data yet

I’m on Ubuntu 14.04, running python 2.7.6. Thanks!!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
chris-b1commented, Aug 9, 2016

Striding is easier to see with distinct values - e.g.

In [65]: arr = np.arange(10); arr
Out[65]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

In [66]: arr.reshape((5,2))
Out[66]: 
array([[0, 1],
       [2, 3],
       [4, 5],
       [6, 7],
       [8, 9]])

The column values [0, 2, …] and [1, 3, …] are not contiguous in memory. You can also work around this by taking a copy df = df.copy(), which in effect is what your type conversions are doing.

2reactions
wesmcommented, May 24, 2017

This is fixed in Feather 0.4 (which depends on pyarrow 0.4.0)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pytorch: non-positive stride is not supported - Stack Overflow
I think the error might have to do with the dimensions of the input data, but I don't understand what "non-positive stride" means....
Read more >
Typed Memoryviews — Cython 3.0.0a11 documentation
Data packing means your data may be contiguous or not contiguous in memory, and may use strides to identify the jumps in memory...
Read more >
Datasets — h5py 3.7.0 documentation
Write data directly to HDF5 from a NumPy array. The source array must be C-contiguous. Selections must be the output of numpy.s_[<args>]. Broadcasting...
Read more >
cuTENSOR Functions - NVIDIA Documentation Center
CUTENSOR_STATUS_NOT_SUPPORTED – if the requested descriptor is not supported (e.g., due to non-supported data type). CUTENSOR_STATUS_INVALID_VALUE – if some ...
Read more >
Troubleshooting and tips — Numba 0.50.1 documentation
There can be various reasons why Numba cannot compile your code, and raises an error instead. One common reason is that your code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found