DataScience
article thumbnail
728x90

 

basic1 (2).csv
0.00MB

 

city와 f4를 기준으로 f5의 평균값을 구한 다음, f5를 기준으로 상위 7개 값을 모두 더해 출력하시오 (소수점 둘째자리까지 출력)

library(dplyr)
df=read.csv("../input/bigdatacertificationkr/basic1.csv")
ans<-df%>%group_by(city,f4)
	%>%summarise(mean_f5 = mean(f5,na.rm=T))
    %>%arrange(-mean_f5)
    %>%head(7)
    %>%ungroup()
    %>%summarise(sum=sum(mean_f5))
    %>%round(2)
print(ans)

정답 : 644

 

profile

DataScience

@Ninestar

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!