我正在尝试使用索引创建一个空数据框并指定列类型.我这样做的方式如下:
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'])
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误,
TypeError: data type not understood
Run Code Online (Sandbox Code Playgroud)
这是什么意思?