Error in code "Time to slice and dice" from course "NLP Course"
MEMBER
You should open an issue in the NLP course website / github page. I'm closing this issue if you don't mind
2025-03-03T17:52:15Z
https://github.com/huggingface/datasets/issues/7430#issuecomment-2695139731
https://api.github.com/repos/huggingface/datasets/issues/7430
IC_kwDODunzps6gpJGT
https://api.github.com/repos/huggingface/datasets/issues/comments/2695139731/reactions
2025-03-03T17:52:15Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2695139731
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
NONE
ok, i don't mind, i'll mark the error there
2025-03-05T11:32:46Z
https://github.com/huggingface/datasets/issues/7430#issuecomment-2700667258
https://api.github.com/repos/huggingface/datasets/issues/7430
IC_kwDODunzps6g-Ol6
https://api.github.com/repos/huggingface/datasets/issues/comments/2700667258/reactions
2025-03-05T11:32:46Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2700667258
https://avatars.githubusercontent.com/u/122965300?v=4
https://api.github.com/users/Yurkmez/events{/privacy}
https://api.github.com/users/Yurkmez/followers
https://api.github.com/users/Yurkmez/following{/other_user}
https://api.github.com/users/Yurkmez/gists{/gist_id}
https://github.com/Yurkmez
Yurkmez
U_kgDOB1RNNA
https://api.github.com/users/Yurkmez/orgs
https://api.github.com/users/Yurkmez/received_events
https://api.github.com/users/Yurkmez/repos
https://api.github.com/users/Yurkmez/starred{/owner}{/repo}
https://api.github.com/users/Yurkmez/subscriptions
User
https://api.github.com/users/Yurkmez
public
### Describe the bug

When we execute code 
```
frequencies = (
    train_df["condition"]
    .value_counts()
    .to_frame()
    .reset_index()
    .rename(columns={"index": "condition", "condition": "frequency"})
)
frequencies.head()
```
answer should be like this

condition      | frequency
birth control | 27655
depression    | 8023
acne              | 5209
anxiety          | 4991
pain               | 4744

but he is different

frequency      | count
birth control  | 27655
depression    | 8023
acne              | 5209
anxiety          | 4991
pain               | 4744

this is not correct, correct code
```
frequencies = (
    train_df["condition"]
    .value_counts()
    .to_frame()
    .reset_index()
    .rename(columns={"index": "condition", "count": "frequency"})
)
````

### Steps to reproduce the bug

```
frequencies = (
train_df["condition"]
.value_counts()
.to_frame()
.reset_index()
.rename(columns={"index": "condition", "condition": "frequency"})
)
frequencies.head()
```

### Expected behavior


condition      | frequency
birth control | 27655
depression    | 8023
acne              | 5209
anxiety          | 4991
pain               | 4744

### Environment info

Google Colab