Skip to content

Commit

Permalink
use .iloc for integer indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-springer committed Dec 18, 2024
1 parent fb78f85 commit 6f9aee1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rdtools/degradation.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def degradation_classical_decomposition(energy_normalized,
# Compute yearly rolling mean to isolate trend component using
# moving average
energy_ma = df['energy_normalized'].rolling('365d', center=True).mean()
has_full_year = (df['years'] >= df['years'][0] + 0.5) & (df['years'] <= df['years'][-1] - 0.5)
has_full_year = (df["years"] >= df["years"].iloc[0] + 0.5) & (
df["years"] <= df["years"].iloc[-1] - 0.5
)
energy_ma[~has_full_year] = np.nan
df['energy_ma'] = energy_ma

Expand Down

0 comments on commit 6f9aee1

Please sign in to comment.