AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas
时间:2018-05-18 21:51:08
收藏:0
阅读:3931
test_behavior_A["var3"]=test_behavior_A["var3"].str.strip("M").astype("float")
上述代码改为:
test_behavior_A["var3"]=test_behavior_A["var3"].astype(str).strip("M").astype("float")
原文:https://www.cnblogs.com/xiaodongsuibi/p/9058050.html
评论(0)