# Numpy.float error using stream.plot

**URL:** <https://discourse.obspy.org/t/numpy-float-error-using-stream-plot/1798>\
**Category:** Uncategorized\
**Created:** [October 3, 2023, 3:06pm UTC](https://discourse.obspy.org/t/numpy-float-error-using-stream-plot/1798 "2023-10-03T15:06:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dormant](https://discourse.obspy.org/user_avatar/discourse.obspy.org/dormant/32/495_2.png) [@dormant](https://discourse.obspy.org/u/dormant)\
**Post date:** [October 3, 2023, 3:06pm UTC](https://discourse.obspy.org/t/numpy-float-error-using-stream-plot/1798/1 "2023-10-03T15:06:03Z")

</div>

I am getting a runtime error on one of my scripts, originating from stream.plot and caused by changes in numpy. How can I get round this?

```python
Traceback (most recent call last):
  File "./plotaDay.py", line 102, in <module>
    main()
  File "./plotaDay.py", line 97, in main
    st.plot( equal_scale=False, size=(1600,800), outfile=file_plot, linewidth=0.2, starttime=plotBeg, endtime=plotEnd )
  File "/home/seisan/anaconda3/envs/obspy/lib/python3.8/site-packages/obspy/core/stream.py", line 1161, in plot
    return waveform.plot_waveform(*args, **kwargs)
  File "/home/seisan/anaconda3/envs/obspy/lib/python3.8/site-packages/obspy/imaging/waveform.py", line 278, in plot_waveform
    self.plot(*args, **kwargs)
  File "/home/seisan/anaconda3/envs/obspy/lib/python3.8/site-packages/obspy/imaging/waveform.py", line 403, in plot
    self.__plot_min_max(stream_new[_i], ax, *args, **kwargs)
  File "/home/seisan/anaconda3/envs/obspy/lib/python3.8/site-packages/obspy/imaging/waveform.py", line 768, in __plot_min_max
    extreme_values = np.empty((pixel_count + 1, 2), dtype=np.float)
  File "/home/seisan/anaconda3/envs/obspy/lib/python3.8/site-packages/numpy/ __init__.py", line 305, in __getattr__
    raise AttributeError( __former_attrs__ [attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

```

---

<div class="post-metadata">

**Author:** ![filefolder](https://discourse.obspy.org/user_avatar/discourse.obspy.org/filefolder/32/411_2.png) [@filefolder](https://discourse.obspy.org/u/filefolder)\
**Post date:** [October 4, 2023, 10:48am UTC](https://discourse.obspy.org/t/numpy-float-error-using-stream-plot/1798/2 "2023-10-04T10:48:38Z")

</div>

probably the easiest way would be to upgrade obspy?

---

<div class="post-metadata">

**Author:** ![dormant](https://discourse.obspy.org/user_avatar/discourse.obspy.org/dormant/32/495_2.png) [@dormant](https://discourse.obspy.org/u/dormant)\
**Post date:** [October 5, 2023, 8:39pm UTC](https://discourse.obspy.org/t/numpy-float-error-using-stream-plot/1798/3 "2023-10-05T20:39:15Z")

</div>

Thanks.

I didn’t think it was out of date, but I’ll check.

---

<div class="post-metadata">

**Author:** ![dormant](https://discourse.obspy.org/user_avatar/discourse.obspy.org/dormant/32/495_2.png) [@dormant](https://discourse.obspy.org/u/dormant)\
**Post date:** [October 5, 2023, 8:47pm UTC](https://discourse.obspy.org/t/numpy-float-error-using-stream-plot/1798/4 "2023-10-05T20:47:17Z")

</div>

That worked. Many thanks. I’m a twit.

---

<div class="post-metadata">

**Author:** ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)\
**Post date:** [October 9, 2023, 8:24am UTC](https://discourse.obspy.org/t/numpy-float-error-using-stream-plot/1798/5 "2023-10-09T08:24:42Z")

</div>

Errors like this, search in our issue tracker and usually you find information about if, when and how it was fixed and if not you can open a ticket to let us know.

> **[obspy/obspy](https://github.com/obspy/obspy/issues/)**
>
> ObsPy: A Python Toolbox for seismology/seismological observatories. - obspy/obspy
