[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.
[Python Examples] 파이썬 리스트 예제: 특정 원소 또는 값 찾기
파이썬 리스트 예제: 특정 원소 또는 값 찾기 포스트 난이도: HOO_Intern # Example Code def find_HOO(x): if "HOO" in x: print("HOO is here!") else: print("HOO is not here.") list1 = [15.6,"Wally",54,"Osvaldo"] list2 = ["Wald","HOO",6] list3 = [1,2,3,4,5,6,7,8,"HOO",10,11] print("List1: ") find_HOO(list1) print("List2: ") find_HOO(list2) print("List3: ") find_HOO(list3) List1: HOO is not here. List2: HOO is here! List3: HO..
2022. 10. 7.