just to make sure.
This code
['st', 'line']
['1', '2nd']
and if I change the 6th line with
So are you saying that with this current code I should be obtaining the right outcome?
What do you think is wrong?
one more thing I think is worth mentioning:
I am trying to import this file by clicking on the arrow
on the top middle of the spyder compiler
and once I write the file name I want to import,
I get this message:
unsupported file extension '.dat'
Would you like to import it anyway?
(by selecting a known file format)
and it still does not work no matter what I select.
This code
file=open('kwh.dat','r')
yearmonthday=[]; kwh1=[]
for i in file:
tempsplit=i.split(" ")
yearmonthday.append(tempsplit[0])
kwh1.append(str(tempsplit[1])) # or kwh1.append((tempsplit[1]))
print(kwh1)
print(yearmonthday)produces this output['st', 'line']
['1', '2nd']
and if I change the 6th line with
kwh1.append(int(tempsplit[1]))I get the error mentioned above.
So are you saying that with this current code I should be obtaining the right outcome?
What do you think is wrong?
one more thing I think is worth mentioning:
I am trying to import this file by clicking on the arrow
on the top middle of the spyder compiler
and once I write the file name I want to import,
I get this message:
unsupported file extension '.dat'
Would you like to import it anyway?
(by selecting a known file format)
and it still does not work no matter what I select.
