Question: Task 2 : Merge Arrays into a Multidimensional Array Merge these three arrays into a new multidimensional array named 'menu _ item _ info'. The

Task 2: Merge Arrays into a Multidimensional Array
Merge these three arrays into a new multidimensional array named 'menu_item_info'. The array should have each row containing an item name, followed by the price,
and then the sales. In other words, the new array should have the same number of rows as the originals, and it should have three columns. Print the structure and
content of 'menu_item_info'.
Insert your Pythos code here
Task 3: Build Array of Extended Sales
Construct a new array named 'menu_item_extended_sales', with a single column equal 'price * sales' for each item from 'menu_jtem_info'. Print the structure and
content new array.
Task 4: Append Extended Sales onto Existing Array
Use 'np.column_stack' to append 'menu_jtem_extended_sales' onto 'menu_item_info'. Then, print the structure and content of the new 'menu_item_info'.
Task 5: Array Aggregate Functions
Calculate and print the sum, mean, standard deviation, min, and max of the extended sales values from 'menu_item_extended_sales':
[]s Insert your Python code bere
Task 6: High-value Items
Create a new NumPy Array named 'high_5_extended_sales' that holds the 5 highest extended prices.
hint:
sort 'menu_item_extended_sales'
Hip to reverse order
slice out the 5 highest rows
Print the structure of the 'high_5_extended_sales' (number of dimensions, the data type of its elements, and the shape). Then print the 'high_5_extended_sales'.
Task 7 Convert to a Pandas DataFrame
Corvert 'menu_item_info' into a Pandas DataFrame named 'menu_item_info_df'. Use the item name as the DataFrame index. Name the other columns as 'Price',
'Sales', and 'Extended Sales'. Print the new DataFrame.
Task 8: Retrieve Specific Data from the DataFrame
Print the row corresponding to the menu item 'Spicy Texas Red Sauce' using the DataFrame index.Task 1 Create NumPy Arrays from Lists
Start by importing the NumPy library. Then, create NumPy arrays for the menu items, prices, and sales from the provided lists. Print the structure of each array-this
should include the number of dimensions, the data type of its elements, and its shape.
menu_item_list =["Wood-fired Smoked Ribs", "Hickory Smoked Brisket", "Tender Pulled Pork",
"Smoky Chicken Halves", "Smoked Sausage Links", "RBC Special Meat Platter",
"Smokehouse Wings", "Smokehouse Turkey", "Texas Style Beef Short Ribs",
"St. Louis Cut Ribs", "Smoked Baked Beans", "Classic Coleslaw", "Sweet Cornbread",
"Country Style Green Beans", "Creamy Mac n' Cheese", "Southern Potato Saad",
"Buttered Corn on the Cob", "Collard Greens", "The Carnivore", "The Garden Patch",
"The RBC Special", "The Cheesy Delight", "The Hot & Spicy", "The Pizza Pie",
"The Wing Master", "The Porky Pig", "The Classic", "Build Your Own Pizza",
"Mini Pulled Pork Sandwich", "Chicken Tenders", "Mac n' Cheese", "Cheese Pizza",
"BBQ Chicken Drumstick", "Grilled Cheese Sandwich", "Kids BBQ Platter",
"Kids Pepperoni Pizza", "Classic Kansas City Sweet Sauce", "Tangy Carolina Gold Sauce",
"Spicy Texas Red Sauce", "Smoky Memphis Sauce", "Honey Mustard Sauce",
"Soda Fountain Classics", "Iced Teas", "Lemonades", "Soft Drinks",
"Freshly Brewed Coffee", "Bread Pudding", "French Silk Caramel Pecan Pie",
"Classic Apple Pie", "Sweet Cherry Pie", "Tart Lemon Meringue Pie",
"Rich Chocolate Cream Pie", "Soda Fountain Creations", "Seasonal Dessert Menu",
"Meats by the Pound", "Whole Pies", "BBQ Family Pack", "Pizza Party Pack"]
menu_item_prices_list =[19.95,23.50,18.25,17.30,14.60,27.99,16.50,19.45,24.99,22.00,
5.99,4.95,3.85,5.50,6.30,5.25,4.75,6.45,16.49,14.99,17.99,15.99,
16.49,17.50,16.45,17.25,14.50,12.99,8.99,7.95,6.99,8.25,7.50,6.45,
9.49,8.50,0.99,0.99,0.99,0.99,0.99,2.25,2.50,2.75,2.25,1.95,6.99,
7.49,6.50,6.50,6.75,7.25,5.99,6.99,9.99,14.99,39.99,32.99]
menu_item_sales_list =[11,14,2,18,5,5,0,4,16,13,10,7,1,10,17,7,12,18,8,0,
6,0,3,0,1,4,0,18,18,1,14,5,15,17,13,19,3,11,10,15,
19,17,0,0,18,1,5,12,19,9,7,19,1,15,3,9,7,2]import numpy as np
menu_items_array = np.array(menu_item_list)
Task 2 : Merge Arrays into a Multidimensional

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 Programming Questions!