Fix dtypes in df loading

This commit is contained in:
2025-11-21 07:44:31 +01:00
parent 5f8493d59e
commit 681a9974b6
+2 -2
View File
@@ -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