Untitled
unknown
python
a year ago
369 B
13
Indexable
import pandas as pd
import numpy as np
df = pd.read_csv('/datasets/vg_sales.csv')
def score_group(score):
if score < 60:
return 'low'
elif score < 80:
return 'medium'
elif score >= 80:
return 'high'
else:
return 'no score'
print(score_group(10))
print(score_group(65))
print(score_group(99))
print(score_group(np.nan))Editor is loading...
Leave a Comment