Dear experts,I think there is no problem, the number of arguments is right,but I got the following error.My friend told me if I wrote as following code,I will succeed.I want to know the reason.Thank you!
The problem is that by default, an np.array() is of type int64 if you have integers in your list, or float64 if you use floating point numbers.
You create your list1 with integers, but then you use this integer array to fill a TH1F, which stores floats (float32 in numpy). However, you can only pass numpy arrays to functions that accept a C-style array if the type matches exactly. Otherwise you get the error that you saw.
The way to work around this is to either construct the numpy array with the correct type as your friend suggests, or use doubles everywhere (which means using the TH1D class):