UFuncTypeError:ufunc'multiply'不包含签名匹配类型为(dtype('<U32'),dtype('<U32'))-> dtype('<U32')的循环

时间:2020-03-22 07:57:14

标签: python pandas dataframe

我无法打印特定状态的详细信息。

代码:

import pandas as pd
file1 = r'D:\Work\Projects\COVID-19\covid_19_data.csv'
df = pd.read_csv(file1)
df1 = df.loc[df['State'] == 'Hubei', ['State', 'Date', 'Confirmed', 'Deaths']]
print (df1.head())
bins = np.linspace(min(df1), max(df1), 4)
print(df1)
group = ["Mild","Severe","Critical"]
df1['Hubei-binned'] = pd.cut(df1, bins, labels=group, include_lowest = True)

0 个答案:

没有答案