카테고리 없음2022. 5. 13. 10:00

import pandas as pd
df = pd.DataFrame([80,90,70,50,40],columns=['mathVal'])
df['Grade'] =list(map(lambda x: "A" if (x >=90) else ("B" if (x >=80) else ("C" if (x >=70) else "D")),df.mathVal))

print(df)
Posted by 오늘보다 나은 내일