Birthday Data Analyzer The purpose of the work: Master the basic methods for work with dictionary, JSON,
Fantastic news! We've Found the answer you've been seeking!
Question:
Birthday Data Analyzer
The purpose of the work: Master the basic methods for work with dictionary,
JSON, matplotlib and bokeh in Python programming language.
Tasks
Birthday Dictionaries
Birthday JSON
Birthday Months
Birthday Plots
Birthday Dictionaries
For this task, we will keep track of famous scientists birthdays, and be able
to find that information based on their name. Create a dictionary in your file of
names and birthdays. When you run your program, it should ask the user to enter a
name, and return the birthday of that person back to them. The interaction should
look something like this:
Welcome to the birthday dictionary. We know the
birthdays of:
Albert Einstein
Benjamin Franklin
Ada Lovelace
Who's birthday do you want to look up
Benjamin Franklin
Benjamin Franklin's birthday is
Birthday JSON
In the previous task we created a dictionary of famous scientists birthdays. In
this exercise, modify your program to load the birthday dictionary from a JSON file,
rather than having the dictionary defined in the program.
Ask the user for another scientists name and birthday to add to the dictionary,
and update the JSON file with the scientists name. If you run the program multiple
times and keep adding new names, your JSON file should keep getting bigger and
bigger.
Birthday Months
In the previous task we saved information about famous scientists names and
birthdays in JSON. In this task, load that JSON file, extract the months of all the
birthdays, and count how many scientists have a birthday in each month.
Your program should output something like:
"May":
"November":
"December":
Birthday Plots
In the previous task we counted how many birthdays there are in each month
in our dictionary of birthdays.
In this task, we use the bokeh Python library to plot a histogram of which
months the scientists have birthdays in Because it would take a long time for you to
input the months of various scientists, you can use my scientist birthday JSON file.
Just parse out the months if you dont know how, I suggest looking at the previous
task and draw your histogram. If you are using a purely webbased interface for
coding, this task wont work for you, since it requires installing the bokeh Python
package pip install bokeh
Requirements for the report
The report should include: a title page, a workflow with a description of all
tasks and the program codes this section consists of a sequential description of the
performed significant steps conclusions and answers to self testing questions.
Questions for selftesting
How to merge two dictionaries?
How to remove a key from a dictionary?
How to sort a dictionary by value?
How to add new keys to a dictionary?
How to return dictionary keys as a list in Python?
How to make a dictionary from separate lists of keys and values?
Is there any way to get all keys from a JSON files data structure in Python?
What does the json.loads method do in Python?
Is it possible to use tuples as keys for dictionaries in Python?
What is the usage of the with statement in Python?
What are the different ways that you can use to encode and decode JSON in
Python?
What is the difference between matplotlib and bokeh?
Whats the best way to draw multiple lines in a single figure in Python?
What is the simplest way to add text annotations and labels to plots in Python?
Why do we need customizing axes?
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date: