AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas
时间:2018-05-18 22:27:34
收藏:0
阅读:2439
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")
评论(0)