我有个错误Can only use .str accessor with string values (i.e. inferred_type is 'string', 'unicode' or 'mixed')
对于此代码
newestdata = newestdf.assign(
idobject=newestdf.index.str.split('/').str[1].str.replace("-", "").str.extract('(\d+)', expand=False).astype(int))
我曾经参与其中的一部分:
OOOO-ASAS/INTEL-64646/OOOO-15445/PPPO-9
但在一个python脚本中是这样的,但在另一个脚本中不是这样的,它工作得很好。你知道问题出在哪里吗?你知道吗
有一个问题,你有混合数据-一些数字与
strings
在index
。你知道吗需要转换为
string
作为第一步:相关问题 更多 >
编程相关推荐