헤맨 만큼 내 땅이다

Python/빅데이터분석기사 실기

빅분기 실기 체험문제 1유형

mm대장 2025. 6. 20. 23:31

1유형은 아래 세가지 함수를 꼭 마스터 하도록 하자

 

groupby

sort_values()

value_counts()

 

import pandas as pd
import math

df = pd.read_csv("data/employee_performance.csv")
#print(df.head())
#print(df.info())

#print(df.isnull().sum())
df['고객만족도'] = df['고객만족도'].fillna(df['고객만족도'].mean())
df = df.dropna(subset=['근속연수'])

#print(df.info())
#print(df.isnull().sum())

#a = df['고객만족도'].quantile(0.75)
#a_trunc = math.trunc(a)
#print(a_trunc)

#print(df.head())

df1 = df.groupby('부서')['연봉'].mean()
#print(df1)

df2 = df1.sort_values(ascending =False)
print(df2.iloc[1])

b= df2.iloc[1]
result = math.trunc(b)
print(result)


#help(df.dropna)