Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
445 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')

developers = ['SquareSoft', 'Enix Corporation', 'Square Enix']
cols = ['name', 'developer', 'na_sales', 'eu_sales', 'jp_sales']

df_filtered = df[(df['na_sales'] > 0) & (df['eu_sales'] > 0) & (df['jp_sales'] > 0) & (df['jp_sales'] > (df['eu_sales'] + df['na_sales']))][cols]
print(df.query(df_filtered).head(5))
Leave a Comment