[Tutor] Question
DL Neil
PyTutor at danceswithmice.info
Thu Apr 9 04:46:09 EDT 2020
> I’m relatively new to Python and I have to complete a coding unit with my University course.
How much Python have you done?
> I’ve been struggling to complete this question I have been given. Essentially, we got an extensive Dataset on car crashes which has a number of columns (index, age, year, crash month, crash day, crash time, road user, gender, crash type) and thousands of data records. I have to create a function which inputs four variables; crash month, crash day, crash time and year and outputs a day of the week Monday - Sunday, the time of the day characterised into Morning, Afternoon, Evening and Night and the season and if any input parameter is incorrect the function returns INVALID in all outputs. I was wondering if you had any advice on this, I’m really struggling. I’ve attached the question to see if you had any pointers.
NB either not attached, or perhaps the format is not acceptable to the
mailing list - it should be a text format.
Firstly, understand your data and detect patterns which you could use to
organise, eg does it make sense to talk about "...month...day...time..."
and then "year"? Does "year" belong first in that sequence? (see also
ISO 8601)
Then look at each control parameter in-turn, eg "day of the week". How
will you transform the data-provided into such terms?
Thus, will you be able to define "valid" or "invalid" for each record?
If you need to ask further questions, please copy-paste your Python code
into your email message to give us something concrete we can help you with.
--
Regards =dn
More information about the Tutor
mailing list