May-06-2022, 01:45 PM
(This post was last modified: May-06-2022, 01:47 PM by Larz60+.
Edit Reason: fixed your bbcode tags
)
Greetings,
The csv returns: [114436]
I want to get the values as an integer and not list, any pointers appreciated.
Thanks
Clive
I still get:
TypeError: list indices must be integers or slices, not list
The csv returns: [114436]
I want to get the values as an integer and not list, any pointers appreciated.
Thanks
Clive
1 2 3 4 5 6 7 8 9 |
##### CSV id = open (manhole, encoding = 'utf-8' ) manhole_id = csv.reader( id ) next ( id , None ) rows = () for row in manhole_id: data_manhole_id = [ int (item) for item in row] print (data_manhole_id) |
Output:[114436]
[114474]
[114514]
NotOutput:114436
114474
114514
I also get an error: TypeErrorTypeError: list indices must be integers or slices, not list