This is Python pandas questions . I am only sending a small part of the CSV file
Fantastic news! We've Found the answer you've been seeking!
Question:
This is Python pandas questions . I am only sending a small part of the CSV file . Just need a very simple script for requirement 4.3 using floordiv( ). Read explanation below
Date | Time Occurred |
8/24/19 | 450 |
8/30/19 | 2320 |
8/25/19 | 545 |
11/20/19 | 350 |
8/30/19 | 2100 |
Requirement 4: (5 points) Create new columns into your data frame:
1. Created a month field from Date field. answered below:
df['Month'] = pd.to_datetime(df['Date']).dt.month
2. Created a day field from Date field. answer below. answered below
df['Day'] = pd.to_datetime(df['Date']).dt.day
3. Please create an hour field from Time Occurred (can handle *mathematically (arithmetically) or as a string).
- For this I'm asking you (tutor) to use floordiv( ) function.
- The hours before and and after. Please ignore the left column. It was just a counting index
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date: