We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a1d4af commit 15ad9eaCopy full SHA for 15ad9ea
1 file changed
dea_conflux/stack.py
@@ -196,7 +196,7 @@ def remove_timeseries_with_duplicated(df: pd.DataFrame) -> pd.DataFrame:
196
197
# Remove entries within 60s, deals with edge cases where duplicates wrap across midnight UTC
198
199
- if "date" in df.columns:
+ if "date" in df.columns and len(df) > 1:
200
df['TIMEDIFF'] = pd.to_datetime(df['date'].shift(-1)) - pd.to_datetime(df['date'])
201
df = df[~(df['TIMEDIFF'] < timedelta(seconds=60))]
202
df = df.drop(columns=["TIMEDIFF"])
0 commit comments