ValueError: Does not understand character buffer dtype format string ('?')
See original GitHub issueI’m trying to build and test SciPy in Colab.
I hit an issue with boolean numpy arrays, this happens in ~100 tests
_______________________________ TestCSR.test_ne ________________________________
scipy/sparse/tests/test_base.py:369: in test_ne
check(dtype)
/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py:2279: in new_func
return func(*args, **kwargs)
/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py:2279: in new_func
return func(*args, **kwargs)
scipy/sparse/tests/test_base.py:355: in check
assert_array_equal_dtype(dat != dat2, (datlil != datsp2).todense())
scipy/sparse/base.py:369: in __ne__
return self.tocsr().__ne__(other)
scipy/sparse/lil.py:478: in tocsr
_csparsetools.lil_flatten_to_array(self.data, data)
_csparsetools.pyx:135: in scipy.sparse._csparsetools.lil_flatten_to_array
???
_csparsetools.pyx:138: in scipy.sparse._csparsetools._lil_flatten_to_array_bool_
???
E ValueError: Does not understand character buffer dtype format string ('?')
_lil_flatten_to_array_bool_
is being generated in _csparsetools.pyx.in
There are some threads on StackOverflow about boolean arrays in cython so I assume that’s the problem. it’s weird I’m the first person to hit this (below you’ll see I have a very recent cython version maybe that’s it) and the CSR to lil code is fairly new (Feb 28th)
it’s possible the solution is to replace the valuetype with uint8 for flatten_to_array_bool_
Scipy/Numpy/Python version information:
Building from head of the git repo
Numpy: 1.18.2 Python 3.6.9 Cython: ‘0.29.16’ (seems to be less than a week old)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
ValueError: Does not understand character buffer dtype format ...
Hello, I keep getting ValueError. My setup is following: Ubuntu 16.04, python 3.6, tensorflow 1.5. Please help me with this error. Thanks!
Read more >Cython: storing unicode in numpy array - Stack Overflow
We do this with a special “buffer” syntax which must be told the datatype (first argument) and number of dimensions (“ndim” keyword-only ...
Read more >memoryview from ndarray with char field - Google Groups
I am having a problem converting a np.ndarray with a character field to a ... ValueError: Does not understand character buffer dtype format...
Read more >More problems with struct in numpy arraysn
cdef np.ndarray[Bin] chunk = np.empty(chunk_sz, dtype=bin_dtype) ValueError: Does not understand character buffer dtype format string (':')
Read more >Does not understand character buffer dtype format string ...
ValueError : Does not understand character buffer dtype format string ('?') 1. 解决方法. 将 coco_eval.py 文件的112行
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This seems to be fixed in Colab by running
pip install --force-reinstall -U cython
@smola I can reproduce in Colab I suspect it’s some environmental setting Colab sets.
This was the relevant data I saw in build / build_ext