Skip to content

Commit 26e5893

Browse files
update pandas version comparison
1 parent 6c5c624 commit 26e5893

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

rdtools/degradation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ def degradation_year_on_year(energy_normalized, recenter=True,
323323
fill_value=0).groupby(level=0).sum()
324324
usage_of_points.name = 'usage_of_points'
325325

326-
if pd.__version__ < '2.0.0':
326+
pandas_version = pd.__version__.split(".")
327+
if int(pandas_version[0]) < 2:
327328
# For old Pandas versions < 2.0.0, time columns cannot be averaged
328329
# with each other, so we use a custom function to calculate center label
329330
YoY_times['dt_center'] = _avg_timestamp_old_Pandas(YoY_times['dt'], YoY_times['dt_left'])

0 commit comments

Comments
 (0)