-3

I have column with this kind of data:

enter image description here

I want to count how many times valu occur in a row. It is a string, so I want to convert this '63,63,63,63,63,63,63,63,63,63,63' to this ['63','63','63'...].

I there any way to do this quickly? Thanks

TigerJ
  • 87
  • 1
  • 6
  • 3
    `row.split(',')` – Iain Shelvington Nov 22 '21 at 07:51
  • What is the source / type of your `row`s, do you use a framework like _pandas_? Some context and a [example] is required to complete and clarify your question. Otherwise I would suggest to research first: e.g. search for [`[python] string to list`](https://stackoverflow.com/search?q=%5Bpython%5D+string+to+list) – hc_dev Nov 22 '21 at 08:06
  • Does this answer your question? [How to convert comma-delimited string to list in Python?](https://stackoverflow.com/questions/7844118/how-to-convert-comma-delimited-string-to-list-in-python) – hc_dev Nov 22 '21 at 08:07

1 Answers1

0

if given string is s

l=s.split(',') 

l is the required list

Nikhil
  • 16
  • 1