c1=[]
for row in c:
c1.append(row[0:13])
c is a variable containing a csv file
i am going through every row in it and i want only the first 14 elements to be in the c1
what am i doing wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Nicer:
if that doesn’t work, you may not assigning to c properly.
Also keep in mind that if you want first 14 characters, you actually want to do row[:14]
Then you get characters 0->13 inclusively, or 14 total.