Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 454 Bytes

Question_3358.md

File metadata and controls

15 lines (12 loc) · 454 Bytes

LeetCode Records - Question 3358 Books with NULL Ratings

Attempt 1: Use isna() to find the ratings that are not null

import pandas as pd

def find_unrated_books(books: pd.DataFrame) -> pd.DataFrame:
    ans = books[books['rating'].isna()]
    ans = ans.sort_values('book_id')
    return ans[['book_id', 'title', 'author', 'published_year']]
  • Runtime: 301 ms (Beats: 100.00%)
  • Memory: 69.80 MB (Beats: 100.00%)