I want to convert the inputted csv.data result horizontal to vertical.
This is my code
import csv
with open('p1.csv', newline='') as f:
reader = csv.reader(f)
for row in reader:
rain=(", ".join(row))
print(rain)
This is the result
4.019310345
6.713103448
1.172413793
2.369655172
0.485517241
I want it to be like below.
4.019310345, 6.713103448, 1.172413793, 2.369655172, 0.485517241
I have tried 'replace' function, it doesn't work. Please help me.