'numpy.ndarray' object has no attribute 'drop'
时间: 2023-09-10 11:08:23 浏览: 288
将numpy.ndarray格式图像转化为_io.BufferedReader格式
The error message implies that you are trying to call the 'drop' method on a NumPy ndarray object, but NumPy arrays do not have a 'drop' method. The 'drop' method is a method of pandas DataFrame and Series objects, not NumPy arrays.
If you are trying to drop elements from a NumPy array, you can use NumPy's indexing functionality to select elements from the array. For example, if you have a 2D NumPy array 'arr' and you want to drop the first row, you can use:
```
arr = arr[1:, :]
```
This will select all rows starting from the second row and all columns.
If you are working with Pandas DataFrame or Series objects and still getting this error, make sure that you are actually working with a DataFrame or Series object and not a NumPy array.
阅读全文