pysal / esda

statistics and classes for exploratory spatial data analysis
https://pysal.org/esda
BSD 3-Clause "New" or "Revised" License
215 stars 55 forks source link

Importing esda: need for update on numpy long #284

Closed giuliaulpiani closed 7 months ago

giuliaulpiani commented 7 months ago

Dear all, I have just installed esda on my Anaconda Prompt. When using Jupyter notebook and running the command "import esda" I get this error "module 'numpy' has no attribute 'long'". This happens because numpy.long was deprecated in numpy 1.20 and it is removed in numpy 1.24 (we would need to have numpy.longlong). See here: https://stackoverflow.com/questions/76389395/attributeerror-module-numpy-has-no-attribute-long. Can this be fixed on the esda side? Otherwise a downgrade of both numpy and pandas would be needed, which is not ideal. Many thanks,

Giulia

martinfleis commented 7 months ago

@giuliaulpiani which version of esda do you have? Can you show the full traceback? I believe that all of these compatibility issues have been fixed and if using the latest versions of the package from the PySAL ecosystem, you should not run into these.

giuliaulpiani commented 7 months ago

Hi @martinfleis, many thanks for your quick reply. I installed it today and if I look at my pip list, I see esda 2.5.1. This is the latest version it seems.

image

This is what I get in the Jupyter environment:

image image

I have restarted the kernel a zillion times, but I always get the same error. Any help is most appreciated

martinfleis commented 7 months ago

As shown in the Traceback , the error does not come from esda but from numba (used by libpysal which is used by esda). It may be that numba is not up to date. I any case, nothing we can solve on our side.

giuliaulpiani commented 7 months ago

Dear @martinfleis many thanks for the suggestion. I have updated numba and it worked. Sorry for the inconvenience. I may grasp the chance and ask you where I can find the best documentation, case studies and tutorials possibly on the use of esda, if you feel like it. Have a great rest of the day and thanks again

martinfleis commented 7 months ago

Glad it worked.

Bits of documentation are in notebooks here (https://github.com/pysal/esda/tree/main/notebooks), more structured explanation is in the book few maintainers wrote (https://geographicdata.science/book/notebooks/06_spatial_autocorrelation.html and https://geographicdata.science/book/notebooks/07_local_autocorrelation.html), I have some stuff in my course (https://martinfleischmann.net/sds/chapter_05/hands_on.html) and others may have bits and pieces at other places. It mostly depends on what exactly are you looking for.