Question: In python: Coding exercise 1 Background In this assignment, you will be working with a dataset that represents the performance of various sectors in different

In python: Coding exercise 1
Background
In this assignment, you will be working with a dataset that represents the performance of various sectors in different regions. Your task is to create a heatmap that visually represents this data, making it easier to identify patterns and trends.
Data
For the purpose of this assignment, we will use the following sectors and regions:
sectors =["Energy", "Healthcare", "Technology", "Consumer Staples"]
regions =["North America", "Europe", "Asia Pacific", "Latin America"]
The performance data is represented as a percentage change and is provided in the form of a 2D NumPy array:
import numpy as np
performance = np.array([
[12,-8,15,4],
[7,10,5,-3],
[20,3,18,8],
[1,-5,2,0]
])
Task
Your task is to create a heatmap that visualizes the performance data. The heatmap should have the following characteristics:
The x-axis should represent the regions.
The y-axis should represent the sectors.
The color intensity should represent the performance percentage change.
Include appropriate labels and a color bar to indicate the scale of the performance.

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!