목록코드카타/Pandas (34)
susinlee 님의 블로그
[문제] Write a solution to show the unique ID of each user, If a user does not have a unique ID replace just show null. Return the result table in any order. The result format is in the following example. [풀이]1. unique_id 가 존재하지 않으면 null을 표시해야하니까 employee 테이블 기준으로 LEFT 조인을 해야함2. unique_id와 name을 조회 Pandasimport pandas as pddef replace_employee_id(employees: pd.DataFrame, employee_uni: pd.DataFr..
[문제] Write a solution to find the IDs of the invalid tweets. The tweet is invalid if the number of characters used in the content of the tweet is strictly greater than 15. Return the result table in any order. [풀이]1. content 컬럼의 길이가 15가 넘어가는 행들을 필터링2. tweet_id 컬럼을 조회 Pandasimport pandas as pddef invalid_tweets(tweets: pd.DataFrame) -> pd.DataFrame: # filter = tweets['content'].str.len() >..