Skip to content

Commit

Permalink
Avoid extra index when grouping data frames
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinkens committed Nov 15, 2023
1 parent e0432dd commit f66c541
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygac_fdr/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _sort_by_ascending_time(self, df):

def _set_global_quality_flag(self, df):
LOG.info("Computing quality flags")
grouped = df.groupby("platform", as_index=False)
grouped = df.groupby("platform", as_index=False, group_keys=False)
return grouped.apply(
lambda x: self._set_global_qual_flags_single_platform(x, x.name)
)
Expand Down Expand Up @@ -355,7 +355,7 @@ def _set_too_long_flag(self, df, max_length=120):

def _calc_overlap(self, df):
LOG.info("Computing overlap")
grouped = df.groupby("platform", as_index=False)
grouped = df.groupby("platform", as_index=False, group_keys=False)
return grouped.apply(self._calc_overlap_single_platform)

def _calc_overlap_single_platform(self, df, open_end=False):
Expand Down

0 comments on commit f66c541

Please sign in to comment.