I'm trying to import some data from an external file to be able to generate a graphic and such, but every time of that error, follows my code:
You can also talk about errors that you found in my code that can be improved, I'm starting in python yet and would like to learn too
import matplotlib.pyplot as plt
class poisson():
def __init__(self):
stopTimes = []
times = []
self.stopTime = stopTimes
self.times = times
def importPoisson(enterArchive):
database = open('import/'+enterArchive+'.csv', 'r')
for count in database:
count = count.strip()
stop,time = count.split(',')
poisson.stopTimes.append(stop)
poisson.times.append(time)
return poisson.stopTimes, poisson.times
def plotGraphic(self):
plt.title("Poisson")
plt.step(poisson.times, poisson.stopTimes, label="Paradas de carros")
plt.legend()
plt.xlabel("Tempo")
plt.ylabel("Paradas")
plt.show()
pos = poisson()
pos.importPoisson("eventEntrance")
pos.plotGraphic()
Follow a print of the data I want to enter