values1 = np.concatenate(np.array(edgesstrange[:20000]), np.array(edgesstrange[200000:])…
- User
values_1 = np.concatenate(np.array(edges_strange[:20000]), np.array(edges_strange[200000:]) / 2) 3 # Фитим гамма-распределение к данным 4 shape, loc, scale = stats.gamma.fit(values_1)
TypeError: only integer scalar arrays can be converted to a scalar index
- Assistant
The error you are encountering indicates that there is a problem with how you are trying to concatenate the arrays in your
np.concatenatefunction. Specifically,np.concatenate()expects a single argument that is an iterable of arrays, but it seems like you are passing separate arguments instead.Here's how to correctly concatenate your arrays:
Instead of this line:
pythonvalues_1 = np.concatenate(np.array(edges_strange[:20000]), np.array(edges_strange[200000:]) / 2)You should wrap the arrays in a list (or a tuple) as follows:
pythonvalues_1 = np.concatenate([np.array(edges_strange[:20000]), np.array(edges_strange[200000:]) / 2])This change ensures that you are passing a single iterable (in this case, a list) to
np.concatenate().