A user database stores account records with an active flag. Return only the rows where the user is active, with the index reset.
df
| column | type |
|---|---|
| user_id | int |
| name | str |
| str | |
| is_active | bool |
| user_id | name | is_active | |
|---|---|---|---|
| 1 | Alice | alice@example.com | True |
| 2 | Bob | bob@example.com | False |
| 3 | Carol | carol@example.com | True |
| 4 | Dave | dave@example.com | False |
| user_id | name | is_active | |
|---|---|---|---|
| 1 | Alice | alice@example.com | True |
| 3 | Carol | carol@example.com | True |
Rows 2 and 4 have is_active = False and are excluded; the remaining two rows are returned with a reset index.
df shape = (3, 4), columns: user_id, name, email, is_active