georgebv / pyextremes

Extreme Value Analysis (EVA) in Python
https://georgebv.github.io/pyextremes/
MIT License
239 stars 47 forks source link

Multi-dimensional indexing (e.g. `obj[:, None]`) is no longer supported. Convert to a numpy array before indexing instead. #69

Closed Yun-Tianming closed 1 year ago

Yun-Tianming commented 1 year ago

Describe the bug Example of user guide's threshold selection, althought i ran it successfully. I create a new environment for it but still fail: conda create --name EVA_env python=3.10 conda activate EVA_env pip install pyextremes[full]

specific part axes = plot_threshold_stability(data, return_period=100, thresholds=np.linspace(0.20, 0.26, 20), progress=True) ERRO: Multi-dimensional indexing (e.g. obj[:, None]) is no longer supported. Convert to a numpy array before indexing instead.

but Mean Residual Life can be ploted. ML89_FNGVWGD{BWK( Y9DSV

georgebv commented 1 year ago

Before answering your question, I don't recommend mixing pip and conda together. Pyextremes is available on conda forge as conda install -c conda-forge pyextremes.

Regarding your question, data must be pandas.Series object with date time index. Try passing it to EVA and see what it tells you https://georgebv.github.io/pyextremes/quickstart/#create-model

Yun-Tianming commented 1 year ago

I confirm that data is a panda.Series object, and if not, Mean Residual Life can not be ploted. I follow your suggestion to recreate a enviroment. Unfortunately, it still don't work as before: conda create --name EVA_env python=3.11 conda activate EVA_env conda install -c conda-forge pyextremes image image

georgebv commented 1 year ago

Please follow all instructions from my previous message (about index and EVA), those should resolve your issue