随笔分类 - python
python学习
摘要:某列转换为字符串:df['BucketType'] = pd.Series(df['BucketType'], dtype="string")df['BucketType'] = pd.Series(df['BucketType'], dtype=pd.StringDtype())df['Bucke
阅读全文
摘要:方法1:要把'[1,2,2,3]'变为[1,2,2,3] 把str '[1,2,2,3]'左右两边的[ ]替换为空,后str.split变为数组[1,2,3,4] 方法2:把一个数组字符串转换为数组: import ast>>> s = '[54, 95, 45, -97, -51, 84, 0,
阅读全文

浙公网安备 33010602011771号