我正在尝试创建一个带有索引的空数据框并指定列类型。我这样做的方式如下:
df = pd.DataFrame(index=['pbp'],
columns=['contract',
'state_and_county_code',
'state',
'county',
'starting_membership',
'starting_raw_raf',
'enrollment_trend',
'projected_membership',
'projected_raf'],
dtype=['str', 'str', 'str', 'str',
'int', 'float', 'float',
'int', 'float'])
但是,我收到以下错误,
TypeError: data type not understood
这是什么意思?