I have a dataframe df with a column called columnList as str.
"1 2,7 8,10 7" Then I converted them to a list as shown :
[1 2,7 8,10 7] I want to convert the value inside list to tuple :
[(1,2),(7,8),(10,7)] Current code :
temp = df['columnList'].str.split(',') result = list(zip(temp[::2], temp[1::2])) print(result) I'm getting empty list.
df looks like this :
column1 columnList YY 1 2,7 8,10 7 Name: df, dtype: object