由于一些数学运算,我正在从熊猫的csv文件读取数据并转换为int
我尝试了converters = {"Price":int})
,但显示错误
order = pd.read_csv('customer_order.csv' , converters = {"Price":int})
cityData = order.groupby('City')
def expensive_item(x):
return x > 3000
order['expensive_item'] = order['Price'].apply(expensive_item)
print (order)
ValueError:以10为底的int()无效文字:'13,000'