Commit cc0b35d Tom Holland
committed
1 parent 2844b2c commit cc0b35d Copy full SHA for cc0b35d
File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,11 @@ def read_file(filepath: str) -> pl.DataFrame:
56
56
all_columns = pl .scan_csv (
57
57
filepath , skip_rows = n_header_lines - 1 , separator = "\t "
58
58
).columns
59
- selected_columns = [
60
- col for col in all_columns if any (sub in col for sub in columns_to_read )
61
- ]
59
+ selected_columns = []
60
+ for substring in columns_to_read :
61
+ found_columns = [col for col in all_columns if substring in col ]
62
+ selected_columns .extend (found_columns )
63
+
62
64
dataframe = pl .read_csv (
63
65
filepath ,
64
66
skip_rows = n_header_lines - 1 ,
@@ -70,7 +72,10 @@ def read_file(filepath: str) -> pl.DataFrame:
70
72
dataframe = dataframe .with_columns (
71
73
(pl .col ("time/s" ) * 1000000 + start ).cast (pl .Datetime ).alias ("Date" )
72
74
)
75
+
76
+
73
77
return dataframe
78
+
74
79
75
80
@classmethod
76
81
def sort_files (cls , file_list : List [str ]) -> List [str ]:
You can’t perform that action at this time.
0 commit comments