Convert a columns of string to list in pandas

前端 未结 4 1250
不思量自难忘°
不思量自难忘° 2020-12-03 15:27

I have a problem with the type of one of my column in a pandas dataframe. Basically the column is saved in a csv file as a string, and I wanna use it as a tuple to be able t

4条回答
  •  佛祖请我去吃肉
    2020-12-03 16:09

    Alternatively, you might consider regular expressions:

    pattern = re.compile("[0-9]\.[0-9]")
    df.LABELS.apply(pattern.findall)
    

提交回复
热议问题