Exception Handling Mission - DQ vs Jupyter


I am getting an error when I try to run some of the code of this mission in jupyter.

The code is:

class Trial(object):
def init(self, datarow):
self.efficiency = float(datarow[0])
self.individual = int(datarow[1])
self.chopstick_length = int(datarow[2])

first_trial = Trial(chopsticks[0])

It works fine in DQ, but throws an error in jupyter. In jupyter, it only works if I use:
first_trial = Trial(chopsticks.iloc[0])
instead of:
first_trial = Trial(chopsticks[0])

But why?

I think you have probably used pandas to read the data into jupyter whereas DQ reads it in as a list.

This code should work in jupyter:

from csv import reader
with open('chopsticks.csv', 'r') as read_obj:
    csv_reader = reader(read_obj)
    data = list(csv_reader)

chopsticks = data[:][1:]