Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
280 B
2
Indexable
Never
import pandas as pd

df = pd.read_csv('/datasets/vg_sales.csv')
df['user_score'] = pd.to_numeric(df['user_score'], errors='coerce')
genres = ['Puzzle', 'Strategy']
df['genre'] = df['genre'].where((df['genre'].isin(genres), 'Misc')


print(df['genre'].value_counts(ascending=True))
Leave a Comment