我有一个包含称为肝炎的记录的数据集 当我执行以下命令时,我会以这种格式获取详细信息。使用此命令将某些列数据类型更改为int。例如
data.PROTIME.astype(int)
当我尝试执行将其转换为float或int时,某些错误如下所示
data.BILIRUBIN.astype(int)
data.dtypes
DIE int64
AGE int64
SEX int64
TEROID object
ANTIVIRALS int64
FATIGUE object
MALAISE object
ANOREXIA object
LIVER BIG object
LIVER FIRM object
SPLEEN PALPABLE object
SPIDERS object
ASCITES object
VARICES object
BILIRUBIN object
ALK PHOSPHATE object
SGOT object
ALBUMIN object
PROTIME object
HISTOLOGY int64
dtype: object
data.BILIRUBIN.astype(int)
AttributeError Traceback (most recent call last)
<ipython-input-203-0de026098a80> in <module>
----> 1 data.BILIRUBIN.astype(int)
~\Anaconda3\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
4374 copy=copy, allow_dups=False)
4375
-> 4376 return obj
4377
4378 def _needs_reindex_multi(self, axes, method, level):
AttributeError: 'DataFrame' object has no attribute 'BILIRUBIN'