Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi there, I am fairly new to Python and was wondering if you could help me with a function that I need to create. These

Hi there,

I am fairly new to Python and was wondering if you could help me with a function that I need to create. These are the instructions:

A function called convert_date that takes date string (in the format as it is given in the dataset csv file) as the input and returns the number of days from that date until now. The number should be negative. For example, today is 14/3/21. The input date is 3/3/21. The function should compute the difference between the input date and today's date and return -11. If the function argument is in incorrect form, the function should return 0. Don't forget to test it.

*Cant use Panda but can use Numpy*

Hopefully I can get some assistance on this, thank you

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions

Question

What is meant by HDD and CDD?

Answered: 1 week ago