Skip to content
Snippets Groups Projects
Commit 2d349c19 authored by Guillaume Valadon's avatar Guillaume Valadon
Browse files

Use list comprehension in diffplot()

parent 6ac34c68
No related branches found
No related tags found
No related merge requests found
...@@ -169,14 +169,13 @@ lfilter: truth function to apply to each packet to decide whether it will be dis ...@@ -169,14 +169,13 @@ lfilter: truth function to apply to each packet to decide whether it will be dis
""" """
# Get the list of packets # Get the list of packets
l = self.res if lfilter is None:
l = [f(self.res[i], self.res[i+1])
# Apply the filter for i in xrange(len(self.res) - delay)]
if lfilter is not None: else:
l = filter(lfilter, l) l = [f(self.res[i], self.res[i+1])
for i in xrange(len(self.res) - delay)
# Apply the function f to compute the difference if lfilter(self.res[i])]
l = map(f, l[:-delay],l[delay:])
# Mimic the default gnuplot output # Mimic the default gnuplot output
if kargs == {}: if kargs == {}:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment