Address pandas deprecation of date_parser for pandas.read_csv
This commit is contained in:
parent
2b069e3031
commit
54346b071e
@ -17,6 +17,8 @@ Upcoming Release
|
|||||||
|
|
||||||
* Renamed script file from PyPSA-EUR ``build_load_data`` to ``build_electricity_demand``.
|
* Renamed script file from PyPSA-EUR ``build_load_data`` to ``build_electricity_demand``.
|
||||||
|
|
||||||
|
* Adressed deprecation warnings for ``pandas=2.0``. ``pandas=2.0`` is now minimum requirement.
|
||||||
|
|
||||||
PyPSA-Eur 0.8.0 (18th March 2023)
|
PyPSA-Eur 0.8.0 (18th March 2023)
|
||||||
=================================
|
=================================
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ dependencies:
|
|||||||
- lxml
|
- lxml
|
||||||
- powerplantmatching>=0.5.5
|
- powerplantmatching>=0.5.5
|
||||||
- numpy<1.24
|
- numpy<1.24
|
||||||
- pandas>=1.4
|
- pandas>=2.0
|
||||||
- geopandas>=0.11.0
|
- geopandas>=0.11.0
|
||||||
- xarray
|
- xarray
|
||||||
- rioxarray
|
- rioxarray
|
||||||
|
@ -80,11 +80,8 @@ def load_timeseries(fn, years, countries, powerstatistics=True):
|
|||||||
def rename(s):
|
def rename(s):
|
||||||
return s[: -len(pattern)]
|
return s[: -len(pattern)]
|
||||||
|
|
||||||
def date_parser(x):
|
|
||||||
return dateutil.parser.parse(x, ignoretz=True)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
pd.read_csv(fn, index_col=0, parse_dates=[0], date_parser=date_parser)
|
pd.read_csv(fn, index_col=0, parse_dates=[0], date_format="%Y-%m-%dT%H:%M:%SZ")
|
||||||
.filter(like=pattern)
|
.filter(like=pattern)
|
||||||
.rename(columns=rename)
|
.rename(columns=rename)
|
||||||
.dropna(how="all", axis=0)
|
.dropna(how="all", axis=0)
|
||||||
|
Loading…
Reference in New Issue
Block a user