Question: I have installed Jupyter Notebook how do i open a terminal or command prompt and type the following command to install Jupyter Notebook: pip install

I have installed Jupyter Notebook how do i open a terminal or command prompt and type the following command to install Jupyter Notebook:
pip install jupyter
Install Required Libraries
You'll need some additional Python libraries for data manipulation and charting:
1. Pandas:
o Pandas is a powerful data manipulation library.
pip install pandas
2. Matplotlib:
Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.pip install matplotlib
3. SciPy:
SciPy is a library used for scientific and technical computing.
pip install scipy
Create the SPC charts.
Step-by-Step Plan:
1. firstly Load the data into a DataFrame.
2. next Calculate the control limits (UCL, LCL) for each site and the overall data.
3. and Generate the SPC charts using Matplotlib.
Use Phyton extract data and convert to dataframe
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Data extraction
data ={
'Hospital Site': ['Birmingham Heartlands', 'Good Hope', 'Solihull', 'Queen Elizabeth', 'TOTAL'],
'Jan-24': [24,21,14,28,22],
'Feb-24': [42,23,16,25,27],
'Mar-24': [22,26,7,26,20],
'Apr-24': [24,28,7,28,22],
'May-24': [29,28,15,28,25],
'Jun-24': [31,32,17,29,27],
'Jul-24': [35,31,19,31,29]
}
# Convert to DataFrame
df = pd.DataFrame(data)
# Function to plot SPC chart
def plot_spc_chart(df, site):
data = df[df['Hospital Site']== site].drop('Hospital Site', axis=1).values.flatten()
months = df.columns[1:]
mean = np.mean(data)
sigma = np.std(data)
UCL = mean +3*sigma
LCL = mean -3*sigma
plt.figure(figsize=(12,6))
plt.plot(months, data, marker='o', linestyle='-', color='b', label='Data')
plt.axhline(mean, color='green', linestyle='--', label='Mean')
plt.axhline(UCL, color='red', linestyle='--', label='UCL (3\sigma )')
plt.axhline(LCL, color='red', linestyle='--', label='LCL (3\sigma )')
plt.title(f'SPC Chart for {site}')
plt.xlabel('Month')
plt.ylabel('Percentage')
plt.legend()
plt.grid(True)
plt.ylim(0, max(UCL, max(data))+10)
plt.show()
# Plot SPC chart for overall data
plot_spc_chart(df, 'TOTAL')
# Plot SPC chart for each site
for site in df['Hospital Site'].unique():
if site != 'TOTAL':
plot_spc_chart(df, site)

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!