Buffer dtype mismatch, expected 'long' but got 'long long'
See original GitHub issuehi, there is an error when I get nodal stress using NodalStress() method. I use the rst file in your closed issues “test_pyansys.rst”. I guess there is something wrong with numpy.int64 type.
the code is below:
stress = result.NodalStress(0)
Traceback (most recent call last):
File "<ipython-input-12-6342d70f8bcd>", line 1, in <module>
stress = result.NodalStress(0)
File "C:\Users\zxmy\Anaconda3\lib\site-packages\pyansys\binary_reader.py", line 977, in NodalStress
self.edge_idx.astype(np.int64))
File "pyansys/cython/_rstHelper.pyx", line 158, in pyansys._rstHelper.LoadStress
ValueError: Buffer dtype mismatch, expected 'long' but got 'long long'
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Buffer dtype mismatch, expected 'Python object' but got 'long ...
This error is coming because of mismatch in index of both dataframe when you try to concat it. I figured out the way...
Read more >Buffer dtype mismatch, expected 'double' but got 'long' · Issue ...
I'm using models from statsmodels.tsa to do time series analysis and I ran into issue of : ValueError: Buffer dtype mismatch, expected 'double' ......
Read more >ValueError: Buffer dtype mismatch, expected 'long' but got ...
I am trying to run test diagnostics on a trained model. The model throws an issue ValueError: Buffer dtype mismatch, expected 'long' but...
Read more >ValueError: Buffer dtype mismatch, expected 'long_t' but got ...
This error comes from cnp.long_t being different than the C Cython type identifier long. (with cimport numpy as cnp). Strangely, this error does ......
Read more >Buffer dtype mismatch, expected 'Python object' but got 'long ...
ValueError : Buffer dtype mismatch, expected 'Python object' but got 'long long' ; TypeError: expected string or bytes-like object · twinpiques ...
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

Ok. I’m closing this issue then. Thanks for testing it out. I’ll be a bit more diligent about keeping cython platform independent. To anyone out there who’s looking to make platform independent code when using numpy and cython, use the following:
Otherwise, you’ll run into issues where an
np.int64is alongfor linux and along longfor windows.Hi @akaszynski ,
I am facing similar issue while running a git code on windows, posted issue here . Could you please help me.