본문 바로가기

전체 글

(13)
[pandas] 결측치 확인, 제거 데이터를 확인할 때 결측치가 있는지 꼭 확인해주어야 한다. 결측치 관련 함수를 살펴보자. 간단한 데이터셋을 만들어준다. import pandas as pd import numpy as np # create a DataFrame with missing values df = pd.DataFrame({'A': [1, 2, np.nan, 4], 'B': [5, np.nan, np.nan, 8], 'C': [9, 10, 11, 12]}) 1. 결측치 확인 : isna(), isnull() 두 함수의 기능은 동일하다. 결측치인 경우 True, 결측치가 아닌 경우 False를 반환해준다. df.isnull() #df.isna() 참고) notnull() 위의 두 함수와는 반대로 결측치가 아닌 경우에 True, 결측치..
[LeetCode | Easy] 1873. Calculate Special Bonus 🔻 문제 링크 https://leetcode.com/problems/calculate-special-bonus/?envType=study-plan&id=sql-i Calculate Special Bonus - LeetCode Can you solve this real interview question? Calculate Special Bonus - Table: Employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | employee_id | int | | name | varchar | | salary | int | +-------------+---------+ employee_i leetcode.com 🔻 ..
[LeetCode | Easy] 196. Delete Duplicate Emails 🔻 문제 링크 https://leetcode.com/problems/delete-duplicate-emails/?envType=study-plan&id=sql-i Delete Duplicate Emails - LeetCode Can you solve this real interview question? Delete Duplicate Emails - Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | email | varchar | +-------------+---------+ id is the primary key column for this leetcode.com 🔻 해..
[LeetCode | Easy] 627. Swap Salary 🔻 문제 링크 https://leetcode.com/problems/swap-salary/?envType=study-plan&id=sql-i Swap Salary - LeetCode Can you solve this real interview question? Swap Salary - Table: Salary +-------------+----------+ | Column Name | Type | +-------------+----------+ | id | int | | name | varchar | | sex | ENUM | | salary | int | +-------------+----------+ id is the primar leetcode.com 🔻 문제 해결 테이블에서 값을 수정하는 문제이다..
[LeetCode | Easy] 183. Customers Who Never Order 🔻 문제 링크 https://leetcode.com/problems/customers-who-never-order/?envType=study-plan&id=sql-i Customers Who Never Order - LeetCode Can you solve this real interview question? Customers Who Never Order - Table: Customers +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | +-------------+---------+ id is the primary key column for t leetcode.co..
[LeetCode | Easy] 584. Find Customer Referee 🔻 문제 링크 https://leetcode.com/problems/find-customer-referee/description/?envType=study-plan&id=sql-i Find Customer Referee - LeetCode Can you solve this real interview question? Find Customer Referee - Table: Customer +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | | referee_id | int | +-------------+---------+ id is the primary leetcode..
[LeetCode | Easy] 595. Big Countries 🔻 문제 링크 https://leetcode.com/problems/big-countries/description/?envType=study-plan&id=sql-i Big Countries - LeetCode Can you solve this real interview question? Big Countries - Table: World +-------------+---------+ | Column Name | Type | +-------------+---------+ | name | varchar | | continent | varchar | | area | int | | population | int | | gdp | int | +-------------+ leetcode.com 🔻 문제 파악 ar..
[LeetCode | Easy] 1757. Recyclable and Low Fat Products 🔻 문제 링크 https://leetcode.com/problems/recyclable-and-low-fat-products/?envType=study-plan&id=sql-i Recyclable and Low Fat Products - LeetCode Can you solve this real interview question? Recyclable and Low Fat Products - Table: Products +-------------+---------+ | Column Name | Type | +-------------+---------+ | product_id | int | | low_fats | enum | | recyclable | enum | +-------------+---------..