diff --git a/Exercises/ex2_5.md b/Exercises/ex2_5.md index 47a7150..ae8072d 100644 --- a/Exercises/ex2_5.md +++ b/Exercises/ex2_5.md @@ -175,7 +175,7 @@ function. import collections ... -class RideData(collections.Sequence): +class RideData(collections.abc.Sequence): def __init__(self): self.routes = [] # Columns self.dates = [] @@ -204,7 +204,7 @@ into 4 separate `append()` operations. # readrides.py ... -class RideData(collections.Sequence): +class RideData(collections.abc.Sequence): def __init__(self): # Each value is a list with all of the values (a column) self.routes = [] diff --git a/Exercises/soln2_5.md b/Exercises/soln2_5.md index eab490e..abe66db 100644 --- a/Exercises/soln2_5.md +++ b/Exercises/soln2_5.md @@ -93,7 +93,7 @@ def read_rides_as_columns(filename): # The great "fake" import collections -class RideData(collections.Sequence): +class RideData(collections.abc.Sequence): def __init__(self): # Each value is a list with all of the values (a column) self.routes = [] diff --git a/Solutions/2_5/readrides.py b/Solutions/2_5/readrides.py index 5c1f1bc..f060da6 100644 --- a/Solutions/2_5/readrides.py +++ b/Solutions/2_5/readrides.py @@ -88,7 +88,7 @@ def read_rides_as_columns(filename): # The great "fake" import collections -class RideData(collections.Sequence): +class RideData(collections.abc.Sequence): def __init__(self): # Each value is a list with all of the values (a column) self.routes = [] diff --git a/Solutions/2_6/colreader.py b/Solutions/2_6/colreader.py index 0b28af6..1d6f67a 100644 --- a/Solutions/2_6/colreader.py +++ b/Solutions/2_6/colreader.py @@ -3,7 +3,7 @@ import collections import csv -class DataCollection(collections.Sequence): +class DataCollection(collections.abc.Sequence): def __init__(self, columns): self.column_names = list(columns) self.column_data = list(columns.values()) @@ -34,4 +34,3 @@ if __name__ == '__main__': tracemalloc.start() data = read_csv_as_columns('../../Data/ctabus.csv', [intern, intern, intern, int]) print(tracemalloc.get_traced_memory()) -