Created
July 25, 2022 07:14
-
-
Save SingAvi/ced0255c80ec5e76704e5f3f3621741b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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