Skip to content

Instantly share code, notes, and snippets.

@SingAvi
Created July 25, 2022 07:14
Show Gist options
  • Save SingAvi/ced0255c80ec5e76704e5f3f3621741b to your computer and use it in GitHub Desktop.
Save SingAvi/ced0255c80ec5e76704e5f3f3621741b to your computer and use it in GitHub Desktop.
#input
csvValue ="col1,col2,col3\n1,pixel5,55\n2,pixel6,10"
ValueSeperatedByN = csvValue.split('\n')
res = {}
for i,index in enumerate(ValueSeperatedByN):
newValues = index.split(',')
values = []
for j in newValues:
values.append(j)
print(values)
if i == 0:
res["head"] = values
else:
res[i-1] = values
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment