https://www.datamanim.com/dataset/03_dataq/typeone.html#id6

 

작업 1유형 — DataManim

Question 각 비디오는 10분 간격으로 구독자수, 좋아요, 싫어요수, 댓글수가 수집된것으로 알려졌다. 공범 EP1의 비디오정보 데이터중 수집간격이 5분 이하, 20분이상인 데이터 구간( 해당 시점 전,후

www.datamanim.com

 

 

Question

전체데이터의 수축기혈압(최고) - 이완기혈압(최저)의 평균을 구하여라

import pandas as pd
df =pd.read_csv('https://raw.githubusercontent.com/Datamanim/datarepo/main/body/body.csv')
df.head()

 

result  = (df['수축기혈압(최고) : mmHg'] - df['이완기혈압(최저) : mmHg']).mean()
print(result)

 

 

 

 

Question

50~59세의 신장평균을 구하여라

result = df[(df.측정나이 <60) & (df.측정나이>=50)].iloc[:,2].mean()
print(result)

 

 

 

Question

연령대 (20~29 : 20대 …) 별 인원수를 구하여라

df['연령대']  =df.측정나이 //10 *10
result = df['연령대'].value_counts()
print(result)

 

 

 

Question

연령대 (20~29 : 20대 …) 별 등급의 숫자를 데이터 프레임으로 표현하라

df.groupby(['연령대','등급']).size()

 

 

 

result = df.groupby(['연령대','등급'],as_index=False).size()
print(result)

 

 

 

Question

남성 중 A등급과 D등급의 체지방률 평균의 차이(큰 값에서 작은 값의 차)를 구하여라

result = abs(df[(df.측정회원성별 =='M') &(df.등급 =='A')].iloc[:,4].mean() -df[(df.측정회원성별 =='M') &(df.등급 =='D')].iloc[:,4].mean())
print(result)

 

 

 

Question

여성 중 A등급과 D등급의 체중의 평균의 차이(큰 값에서 작은 값의 차)를 구하여라

result = abs(df[(df.측정회원성별 =='F') &(df.등급 =='A')].iloc[:,3].mean() -df[(df.측정회원성별 =='F') &(df.등급 =='D')].iloc[:,3].mean())
print(result)

 

 

 

 

Question

bmi는 자신의 몸무게(kg)를 키의 제곱(m)으로 나눈값이다.

데이터의 bmi 를 구한 새로운 컬럼을 만들고 남성의 bmi 평균을 구하여라

df['bmi'] = df['체중 : kg'] / (df['신장 : cm']/100) **2
result = df[df.측정회원성별 =='M'].bmi.mean()

print(result)

 

 

 

Question

bmi보다 체지방율이 높은 사람들의 체중평균을 구하여라

result =df[df.bmi <df['체지방율 : %']]['체중 : kg'].mean()
print(result)

 

 

 

Question

남성과 여성의 악력 평균의 차이를 구하여라

target= df.groupby('측정회원성별')['악력D : kg'].mean()
target

 

 

 

target= df.groupby('측정회원성별')['악력D : kg'].mean()

result = target.M - target.F
print(result)

 

 

 

 

 

Question

남성과 여성의 교차윗몸일으키기 횟수의 평균의 차이를 구하여라

target= df.groupby('측정회원성별')['교차윗몸일으키기 : 회'].mean()

result = target.M - target.F
print(result)

 

 

 

 

 

 

 

+ Recent posts