1. KeyError: 100

This error occurs because you are trying to drop a column with an invalid axis number. The valid axis numbers are 0 and 1, which represent the rows and columns respectively. In your code, you are trying to drop a column with axis=100, which is not a valid axis number. To fix this error, you should specify the correct axis number, which is 1 in this case.

  1. ValueError: No axis named 100 for object type DataFrame

This error occurs because you are trying to drop a column with an invalid axis name. In pandas, the axis names are 'index' and 'columns', which represent the rows and columns respectively. In your code, you are trying to drop a column with axis=100, which is not a valid axis name. To fix this error, you should specify the correct axis name, which is 'columns' in this case.

  1. ValueError: Cannot use mean strategy with non-numeric data:

This error occurs because you are trying to impute missing values in a non-numeric column using the mean strategy. The mean strategy can only be used for numeric data, but your data contains non-numeric values such as '?'. To fix this error, you should either remove the non-numeric values or use a different imputation strategy such as the most frequent value or a constant value

KeyError Traceback most recent call lastFile ~anaconda3libsite-packagespandascoregenericpy550 in NDFrame_get_axis_numbercls axis 549 try-- 550 return cls_AXIS_T

原文地址: https://www.cveoy.top/t/topic/hngw 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录