Question
Can someone please help me with this task. This is the third time am posting task 1 and am still getting multiple errors. An stuck
Can someone please help me with this task. This is the third time am posting task 1 and am still getting multiple errors. An stuck on task 1c. please provide different answers if there are different ways to run the code. Thanks.
Task 1
Simulation
A. Use np.random.randint to simulate age data for 100 adults, whose age range from 18 to 36.
Then, calculate basic descriptive statistics (mean, median, standard deviation) for your simulated data.
B. Repeat the process in Question A, except the age range is now 27 to 54.
C. Visualization
Display each age grouop using a side-by-side boxplot. You MUST use either matplotlib or seaborn library for this task.
Note: question A and B has been answered. In 1a, i simulate age data.
import numpy as np age_group1 = np.random.randint(18, 37, size=100)
Also 1b, i simulate age data.
age_group2 = np.random.randint(27, 55, size=100)
Note: For question C, my code is displayed below.
I need to display each age group using a side-by-side boxplot. You MUST use either matplotlib or seaborn library for the task.
Note: I was told by previous expert to import pandas but i still got this error. "FileNotFoundError"
I also tried this
import pandas as pd df = pd.read (age_group1, age_group2) but i got "AttributeError: module 'pandas' has no attribute 'read' "
import pandas as pd
df = pd.read_csv(' file_name.csv')
import matplotlib.pyplot as plt import seaborn as sns sns.boxplot(x='age_group', y='age', data=df, width=0.4, color='lightblue') plt.show()
Note: This was the error message i got for question C
NameError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_12632\610683687.py in2 import matplotlib.pyplot as plt 3 import seaborn as sns ----> 4 sns.boxplot(x='age_group', y='age', data=df, width=0.4, color='lightblue') 5 plt.show() 6 NameError: name 'df' is not defined
Task 2
In this Markdown cell, interpret the P-value you obtained, in English.
P-Value: 1.8067890352578887e-09
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started