pandas 데이터 가공 query groupby agg merge concat


pandas 데이터 가공 query groupby agg merge concat

오늘은 파이썬 데이터 분석을 하는데 있어서 필수로 알아야 할 함수인 query, groupby, agg, merge, concat 함수에 대해서 알아보겠습니다. 1. 조건에 맞는 데이터만 추출하기 query() : 행 추출 exam.query('english <= 80') # 여러 조건 동시 충족 exam.query('nclass == 1 & math >= 50') # 여러 조건 중 하나 이상 충족 exam.query('math >= 90 | english >= 90') exam.query('nclass in [1, 3, 5]') df.query() 함수 안에 따옴표를 이용하여 조건을 써주시면 됩니다. 2. 필요한 변수만 추출하기 df[ ] exam['math'] # 한 변수 추출 exam[['nclass', 'math', 'english']] # 여러 변수 추출 exam.drop(columns = 'math') # 변수 제거 exam.drop(columns = ['math', 'e...


#agg #파이썬 #통계학과 #데이터분석 #query #python #pandas #merge #groupby #concat #판다스

원문링크 : pandas 데이터 가공 query groupby agg merge concat