Skip to content

Commit

Permalink
fix: Resolve grouping column warning in backwards compatible manner
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed Apr 6, 2024
1 parent 744dc33 commit fe33a9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bioframe/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ def _each(chrom_group):
seq = str(seq[:])
gc = []
for _, bin in chrom_group.iterrows():
s = seq[bin.start : bin.end]
s = seq[bin["start"] : bin["end"]]
gc.append(seq_gc(s, mapped_only=mapped_only))
return gc

agg = df.groupby("chrom", sort=False).apply(_each, include_groups=False)
agg = df.groupby("chrom", sort=False)[["start", "end"]].apply(_each)
out_col = pd.Series(data=np.concatenate(agg.values), index=df.index).rename("GC")

if return_input:
Expand Down

0 comments on commit fe33a9d

Please sign in to comment.