Fix dtypes in df loading
This commit is contained in:
@@ -134,7 +134,7 @@ class EvenlySpacedDataset(BaseDataset):
|
||||
# Preload all data into memory
|
||||
self.data = []
|
||||
for fp in self.filepaths:
|
||||
df = pd.read_csv(fp)
|
||||
df = pd.read_csv(fp, dtype={"icao": str, "r": str, "t": str, "timestamp": float, "lat": float, "lon": float, "alt": float, "ias": float})
|
||||
n_rows = len(df)
|
||||
# Extract windows
|
||||
for w in range(n_windows_per_file):
|
||||
@@ -217,7 +217,7 @@ class EvenlySpacedStreamingDataset(BaseDataset):
|
||||
|
||||
# Read only the required rows
|
||||
skip = list(set(range(1, start_idx + 1)))
|
||||
df = pd.read_csv(fp, skiprows=skip, nrows=self.window_size * self.step).iloc[::self.step]
|
||||
df = pd.read_csv(fp, skiprows=skip, nrows=self.window_size * self.step, dtype={"icao": str, "r": str, "t": str, "timestamp": float, "lat": float, "lon": float, "alt": float, "ias": float}).iloc[::self.step]
|
||||
df = self._modify_df(df)
|
||||
|
||||
# Slice into input / decoder-input / targets
|
||||
|
||||
Reference in New Issue
Block a user