[Python Examples] pd.DataFrame(): Section별 학생 구분하여 출력하기
pd.DataFrame(): Section별 학생 구분하여 출력하기 포스트 난이도: HOO_Intern # Example Codes import pandas as pd df = pd.DataFrame({"section": [3,1,1,2,2,3], "students": ['James', 'Julia', 'Megan', 'Henry', 'Minji', 'Yelin']}) sec_1 = df[df['section'] == 1] sec_2 = df[df['section'] == 2] sec_3 = df[df['section'] == 3] print(sec_1) print(sec_2) print(sec_3) section students 1 1 Julia 2 1 Megan section students 3 2 ..
2022. 10. 28.