Question: In this question, you have to write a program that processes the data for a book lending library. You have the following input data: The

In this question, you have to write a program that processes the data for a book lending library. You have the following input data:

The available books per author (numbers are book IDs):

Smith: 1, 3, 3, 3, 1, 5, 5, 2, 4, 4

Jones: 6, 6, 7, 8, 9, 9, 7, 9, 9, 10

Hope: 11, 12, 13, 14, 15, 11, 12, 13, 14, 15

Mason: 16, 17, 18, 18, 18, 19, 20, 20, 16, 20

Doe: 21, 21, 21, 21, 21, 22, 22, 22, 22, 22

Information about the genre of each author:

Romantic: Smith, Hope, Doe

Adventure: Jones, Mason

Your program must do the following:

Stores the information about the books and their genre in Pandas DataFrames (N.B can be more than one dataframe).

Generates at random the borrowing of books for a week as follows: each week 10 unique books are borrowed at random. At the end of each week, all books are returned. Your program should use vectorization and make use of NumPy to make the process more efficient.

Generate the borrow statistics for 10 weeks and print the following information: The number of borrows per authors, organized by genre. The most popular book in each genre.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!