Skip to content

Commit 41c5d6f

Browse files
committed
Fix lstrip column corruption and time series indexing in frq_base.py
1 parent 3ac7bec commit 41c5d6f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

malariagen_data/anoph/frq_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def plot_frequencies_heatmap(
276276
heatmap_df.set_index(index_col, inplace=True)
277277

278278
# Clean column names.
279-
heatmap_df.columns = heatmap_df.columns.str.lstrip("frq_")
279+
heatmap_df.columns = heatmap_df.columns.str.removeprefix("frq_")
280280

281281
# Deal with width and height.
282282
if width is None:
@@ -385,8 +385,8 @@ def plot_frequencies_time_series(
385385

386386
# Build a long-form dataframe from the dataset.
387387
dfs = []
388-
for cohort_index, cohort in enumerate(df_cohorts.itertuples()):
389-
ds_cohort = ds.isel(cohorts=cohort_index)
388+
for cohort in df_cohorts.itertuples():
389+
ds_cohort = ds.isel(cohorts=cohort.Index)
390390
df = pd.DataFrame(
391391
{
392392
"taxon": cohort.taxon,

0 commit comments

Comments
 (0)