comparison python/pavement.py @ 434:9a714f32fc9f

small updates
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Sat, 30 Nov 2013 18:03:35 -0500
parents d40ad901b272
children 830136bc0e18
comparison
equal deleted inserted replaced
433:d40ad901b272 434:9a714f32fc9f
21 def plot(self, measure, options = 'o', dayRatio = 1., **kwargs): 21 def plot(self, measure, options = 'o', dayRatio = 1., **kwargs):
22 from matplotlib.pyplot import plot 22 from matplotlib.pyplot import plot
23 plot(self.data['jours']/float(dayRatio), 23 plot(self.data['jours']/float(dayRatio),
24 self.data[measure], options, **kwargs) 24 self.data[measure], options, **kwargs)
25 25
26 def getMarkingMeasures(self, measure, ligneNum): 26 def getMarkingMeasures(self, dataLabel):
27 from numpy import isnan 27 from numpy import isnan
28 dataLabel = '{}_{}'.format(measure, ligneNum)
29 nonZeroIndices = ~isnan(self.data[dataLabel]) 28 nonZeroIndices = ~isnan(self.data[dataLabel])
30 return self.data[nonZeroIndices]['jours'], self.data[nonZeroIndices][dataLabel] 29 return self.data[nonZeroIndices]['jours'], self.data[nonZeroIndices][dataLabel]
31 30
32 def plotMarkingMeasures(self, measure, options = 'o', dayRatio = 1., **kwargs): 31 def plotMarkingMeasures(self, measure, options = 'o', dayRatio = 1., **kwargs):
33 for i in range(1,7): 32 for i in range(1,7):