Kaggle / Kaggle/learntools

Bug in make_leads function

Open
#467 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
514
Forks
274
PR merge metrics
No merged PRs in 30d

Description

Bug in the following file: https://github.com/Kaggle/learntools/blob/master/learntools/time_series/utils.py

The function doesn't correctly create the leads. For example, setting leads to 1, it just copies the existing columns under a new column named: {name}_lead_0. See the attached screenshot for an example.

def make_leads(ts, leads, name='y'):
return pd.concat(
{f'{name}_lead_{i}': ts.shift(-i)
for i in reversed(range(leads))},
axis=1)

![image](https://github.com/Kaggle/learntools/assets/30698389/6c53f44e-d6ed-4e1a-bf82-e5ed45c5aae4)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.