Series的str属性
格式:XXX.str.strip()
只有Series可用,即某列。
print(alibaba.head())
#对于索引列,是Series,Series有str属性
alibaba.index=pd.DatetimeIndex(alibaba.index.str.strip("'"))
print(alibaba.head())
参考Pandas官方文档
https://www.pypandas.cn/docs/user_guide/text.html#%E6%8B%86%E5%88%86%E5%92%8C%E6%9B%BF%E6%8D%A2%E5%AD%97%E7%AC%A6%E4%B8%B2