Mar-15-2019, 10:16 AM
(This post was last modified: Mar-15-2019, 10:16 AM by dxfrelince.)
Hi,
I've got a file consisting of dates, GD17, electric and heat. The teacher wants me to make a list and also that the date
has a string and everything else as a float.
When I try this, I get:
I've got a file consisting of dates, GD17, electric and heat. The teacher wants me to make a list and also that the date
has a string and everything else as a float.
When I try this, I get:
def load_data( filename, skiprows): infile = open('load_data.csv','r') infile.readline() load_data() for lines in infile: date = str(infile[line[0]]) GD17 = float(infile[lines[1]]) Electric = float(infile[lines[2]]) Heat = float(infile[lines[3]]) load_data.append([date, GD17, Electric, Heat]) TypeError: '_io.TextIOWrapper' object is not subscriptable