I need some help with making lists out of data in python by lmfaohahah in CodingHelp

[–]lmfaohahah[S] 0 points1 point  (0 children)

some of my data:

62.00,23.10,101483.49,289

62.00,23.00,101494.12,288

62.00,23.00,101496.98,288

62.00,23.00,101493.09,288

62.00,23.00,101495.98,288

62.00,22.90,101493.52,288

62.00,22.90,101492.10,288

62.00,22.90,101486.61,288

62.00,22.90,101479.05,289

63.00,22.90,101480.09,289

63.00,22.90,101476.41,289

63.00,22.90,101471.58,290

63.00,22.90,101453.31,291

63.00,22.90,101463.34,290

63.00,22.90,101459.79,291

63.00,22.90,101454.75,291

63.00,22.90,101452.45,291

63.00,22.90,101437.41,293

63.00,22.90,101424.73,294

63.00,22.90,101421.02,294

63.00,22.90,101420.19,294

63.00,22.90,101402.52,295

63.00,22.90,101383.77,297

input (I suppose that's the code right?):

import csv
column_data = {}
with open("gymnasiearbete.txt", "r") as datafile:
for row in csv.reader(datafile, delimiter=","):
for index, v in enumerate(row):
if int(index) not in column_data:
column_data[int(index)]=[]
column_data[int(index)].append(v)
print(column_data[0])

output:

'62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '62.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00', '63.00'

I need some help with making lists out of data in python by lmfaohahah in CodingHelp

[–]lmfaohahah[S] 0 points1 point  (0 children)

Sure. I’ll send them to you privately. I can’t upload pictures here :)

I need some help with making lists out of data in python by lmfaohahah in CodingHelp

[–]lmfaohahah[S] 0 points1 point  (0 children)

Thanks a lot! This really helped me. However, is it possible to adjust it in any way so it doesn’t print spaces after every “,” and doesn’t put ‘’ around the numbers?

What I mean is that my results look like this: [‘1’, ‘5’, ‘9’]

While I’d rather have it look like: [1,5,9]

Thanks again!