analyse and plot pulses raises error message #24
Replies: 1 comment 1 reply
-
As explained in the header of the script, the idea is to execute it only in chunks, as needed. That lower part of the script which throws an error for you, using wf.hexbins(), is an extra which can be easily skipped (comment it out or move the I am realising this is a way of using the script is a bit too unusual for some, especially beginners. I will upload soon an update that simplifies the file loading via a command line parameter and skip the unnecessary parts of the code. |
Beta Was this translation helpful? Give feedback.
-
Hi Together,
I downloaded the script and installed all python packages. Now I wanted it to run and I get error messages:
TypeError: float() argument must be a string or a number, not 'list'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".../diode_detector/analyse_and_plot_pulses.py", line 688, in
hb = wf.hexbin(np.ravel(xpulses), np.asarray(ypulses).ravel(), gridsize=188, cmap='Greens', mincnt=1, vmax=100)
File "/usr/lib/python3/dist-packages/matplotlib/init.py", line 1814, in inner
return func(ax, *args, **kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 4077, in hexbin
x = np.array(x, float)
ValueError: setting an array element with a sequence.
I added some prints and in the code when it fills the xpluses it somehow adds "list(...,...,...,)"
I think the code needs to be changed as it was written for a certain version of matplotlib and numpy.
Does anyone have suggestions?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions