考虑系列数据2:
name = input("\n Please enter your full name: (first middle last) ")
name_list = name.split()
print(name_list[1])
代码:
data2.head()
0 20075E,
1 20109C,
2 202217,
3 20219E,
4 20217C,
Name: 0, dtype: object
工作正常,并产生:
data3 = data2.str.slice(0,5)
data3.head()
但是运行
0 20075
1 20109
2 20221
3 20219
4 20217
Name: 0, dtype: object
似乎什么也没做。为什么?