본문 바로가기

Algorithm

(131)
[stratascratch] Order Details(Python) 문제 Find order details made by Jill and Eva. Consider the Jill and Eva as first names of customers. Output the order date, details and cost along with the first name. Order records based on the customer id in ascending order. Jill과 Eva가 만든 주문을 찾아서 주문 날짜, 상세 내역 및 비용을 이름과 함께 출력하기 고객 ID를 기준으로 오름차순으로 정렬 코드 # Import your libraries import pandas as pd # Start writing code result = pd.merge(customers, o..
[stratascratch] Largest Olympics(Python) 문제 Find the Olympics with the highest number of athletes. The Olympics game is a combination of the year and the season, and is found in the 'games' column. Output the Olympics along with the corresponding number of athletes. 선수 수가 가장 많은 올림픽 찾기. 해당 선수 수와 함께 games를 출력 코드 # Import your libraries import pandas as pd # Start writing code olympics_athletes_events.head() olympics_athletes_events[['gam..
[stratascratch] find the top 10 ranked songs in 2010(Python) 문제 Find the top 10 ranked songs in 2010 What were the top 10 ranked songs in 2010? Output the rank, group name, and song name but do not show the same song twice. Sort the result based on the year_rank in ascending order. 2010년에 top10에 들었던 노래 조회하기. 같은 노래가 중복되면 안되고, year_rank를 기준 오름차순으로 정렬하라 코드 # Import your libraries import pandas as pd # Start writing code billboard_top_100_year_end.head() bill..
[stratascratch] number of bathrooms and bedrooms(Python) 문제 Number Of Bathrooms And Bedrooms Find the average number of bathrooms and bedrooms for each city’s property types. Output the result along with the city name and the property type. 각각의 city와 property_type별로 bedrooms와 bathrooms의 평균 구하기 코드 airbnb_search_details.groupby(['city','property_type'])[['bedrooms','bathrooms']].mean() 인덱스에 있는 값을 컬럼으로 빼주기 위해서 reset_index() 사용 # Import your libraries imp..