Skip to content

Fix deprecations for pandas DataFrame #502

@xoolive

Description

@xoolive
tests/test_datasets.py::test_scat
tests/test_datasets.py::test_scat_waypoints
  /home/runner/work/traffic/traffic/src/traffic/data/datasets/scat.py:197: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
    self.flight_plans = pd.concat(flight_plans)

tests/test_datasets.py::test_scat
tests/test_datasets.py::test_scat_waypoints
  /home/runner/work/traffic/traffic/src/traffic/data/datasets/scat.py:198: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
    self.clearances = pd.concat(clearances)

tests/test_filter.py::test_ekf
  /home/runner/work/traffic/traffic/src/traffic/algorithms/filters/ekf.py:38: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
    dt = (timestamps[i] - timestamps[i - 1]).total_seconds()

tests/test_filter.py::test_ekf
  /home/runner/work/traffic/traffic/src/traffic/algorithms/filters/ekf.py:58: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
    if abs(nu[j]) > abs(reject_sigma * std_devs[j]):

tests/test_flight.py::test_agg_time
  /home/runner/work/traffic/traffic/src/traffic/core/flight.py:1614: FutureWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.
    .apply(lambda df: fun(self.__class__(df)))

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions