Readable Book Due Dates
Problem
You are given a DataFrame `duedates` with a single column `due_on` holding the date (as a string like `'2023-03-14'`) each borrowed library book must be returned.
Turn each `due_on` date into a human-readable string of the form `'weekday, month day, year'`, for example `'Tuesday, March 14, 2023'`. The weekday and month must be full English names, the day has no leading zero, and the year is the four-digit number.
Return a single column named `due_label`, in any order.
Input data
Example rows — the live problem includes the full dataset.
| due_on |
|---|
| 2023-03-14 |
| 2023-11-23 |
| 2024-02-29 |
Expected output
Your answer should return 3 rows with the columns due_label.
Starter code (Pandas (Python))
import pandas as pd
def readable_due_dates(duedates) -> pd.DataFrame:
# Your code here
return duedatesSolve this Pandas question free
Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock