python - numpy warnings in PyCharm - Stack Overflow

Today I have been through the wringer.I code these small projects for fun in Python and in my current

Today I have been through the wringer.

I code these small projects for fun in Python and in my current project, I mainly toy around with numpy. I needed an array for strings and stumbled upon StringDType. To use it, I had to upgrade to numpy 2, which I did. But then suddenly everything was wrong. Everything began to malfunction and the type-checker went nuts. This led to a 9 hour marathon, where ChatGPT guided me through a lot of different steps. I have upgraded, uninstalled, reinstalled, repaired, restarted, rebooted, manually removed and invalidated caches. Pretty much every bit of Python, PyCharm, pip, numpy, mypy and whatever else, you can think of, is now up to date. Finally after some 8.5 hours, me and ChatGPT began to see an end to the issues. Now everything should be the latest stable versions. But my question is this:

I still get a warning for for example:

count: int = np.frombuffer(buffer.read(4), dtype='>u4', count=1)[0]

where it says that ndarray does not define getitem. Which of course is wrong. It does define getitem and the code works as expected.

And my import:

from numpy.dtypes import StringDType

still does not work (which was the whole point of the process to begin with).

I really am at my wits end here. ChatGPT is going in circles at this point: suggesting things we have tried like 5 or 6 times already. I am autistic, and those warnings irk me, like you wouldn't believe. And the fact that I still don't have access to StringDType after all that work, really makes me sad. It is most likely some sort of type-checker within PyCharm, that needs to be updated, removed or replaced, but I am unable to locate it myself. I have tried manually turning off various warnings in Settings/Editor/Inspections, but none seem to do the trick. And it doesn't feel right to me anyways - just ignoring warnings. I would prefer to get a working type-checker.

Any help is appreciated Thomas

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745203759a4616483.html

相关推荐

  • python - numpy warnings in PyCharm - Stack Overflow

    Today I have been through the wringer.I code these small projects for fun in Python and in my current

    11小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信