tezvyn:

Convert string timestamps to datetime and extract day of week

Source: pandas.pydata.orgintermediate

This tests pandas datetime parsing and accessor fluency. A strong answer uses pd.to_datetime, assigns the result, then extracts the day via .dt.day_name() or .dt.dayofweek. Red flag: manual string splitting or Python loops instead of vectorized ops.

This evaluates practical fluency with pandas time-series tooling, specifically parsing strings into datetime64 objects and using datetime accessors for feature engineering. First, call pd.to_datetime(df['timestamp']) for vectorized parsing, optionally specifying format to speed up inference. Second, assign the result to a new column or overwrite the original. Third, extract the day of week using the .dt accessor, such as .dt.day_name() for labels or .dt.dayofweek for integers.

Read the original → pandas.pydata.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Convert string timestamps to datetime and extract day of week · Tezvyn