1 answer

Use numpy % growth of Weight Watchers Stock Daily # of Walmart Toy Units Sold 1.937...

Question:

B. (3 points) Using Python, parse the provided CSV file and do the following: 1. Calculate the mean, median, and mode of eachuse numpy

% growth of Weight Watchers Stock Daily # of Walmart Toy Units Sold
1.937 1
0.334 4
0.913 4
0.771 4
0.346 7
0.913 2
4.242 3
2.595 6
0.526 5
0.807 3
0.076 3
2.355 4
0.98 4
0.605 5
2.192 4
0.1 3
0.457 2
0.099 2
0.461 3
4.253 1
1.151 5
2.19 5
0.463 7
2.802 2
0.395 3
0.739 6
1.186 3
0.661 4
0.347 6
0.206 3
1.153 3
1.167 5
1.064 9
0.406 4
0.15 2
0.272 3
0.133 3
0.138 0
1.756 5
0.162 5
0.041 5
0.261 3
0.134 8
2.697 3
0.436 3
B. (3 points) Using Python, parse the provided CSV file and do the following: 1. Calculate the mean, median, and mode of each dataset (column). 2. Calculate the variance and standard deviation of each dataset. 3. Calculate the number of data points in each dataset. 4. Calculate the minimum, maximum, and range of each dataset. 5. Plot each dataset using matplotlib. The charts should have a title, x- and y-axis labels, and grid lines (horizontal / vertical).

Answers

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
dataset=pd.read_csv(r"C:\Users\MAHE\Desktop\data.csv")
##part 1
col1=dataset['% growth of Weight Watchers Stock']
col2=dataset['Daily # of Walmart Toy Units Sold']
print('mean of % growth of Weight Watchers Stock: ',np.mean(col1))
print('mean of Daily # of Walmart Toy Units Sold: ',np.mean(col2))
print('median of % growth of Weight Watchers Stock: ',np.median(col1))
print('median of Daily # of Walmart Toy Units Sold: ',np.median(col2))
print('mode of % growth of Weight Watchers Stock: ',stats.mode(col1)[0])
print('mode of Daily # of Walmart Toy Units Sold: ',stats.mode(col2)[0])

##part 2
print('variance of % growth of Weight Watchers Stock: ',np.var(col1))
print('variance of Daily # of Walmart Toy Units Sold: ',np.var(col2))
print('standard deviation of % growth of Weight Watchers Stock: ',np.std(col1))
print('standard deviation of Daily # of Walmart Toy Units Sold: ',np.std(col2))

###part 3
print('no of data points:', len(col1))

##part4
print('min of % growth of Weight Watchers Stock: ',np.min(col1))
print('min of Daily # of Walmart Toy Units Sold: ',np.min(col2))
print('max of % growth of Weight Watchers Stock: ',np.max(col1))
print('max of Daily # of Walmart Toy Units Sold: ',np.max(col2))
print('range of % growth of Weight Watchers Stock: ',[np.min(col1),np.max(col1)])
print('range of Daily # of Walmart Toy Units Sold: ',[np.min(col2),np.max(col2)])

plt.scatter(col1,col2)
plt.xlabel(' % growth of Weight Watchers Stock')
plt.ylabel('Daily # of Walmart Toy Units Sold')
plt.grid()
plt.show()

mean of Daily # of Walmart Toy Units Sold: 3.888888888888889 median of % growth of Weight Watchers Stock: 0.605 median of Dai

.

Similar Solved Questions

1 answer
6) Answer the following questions: a) (5 points) Using the Fourier transform, find the value of...
6) Answer the following questions: a) (5 points) Using the Fourier transform, find the value of the following integral S. sinc(Be)dt b) (5 points) Find the Amplitude and phase spectra of the following signal x(t) Ae=sin(5t), t20, t<0. 10. c) (5 points) Find the Fourier transform of v(t) 1...
1 answer
How do you solve #5/12 = x/420#?
How do you solve #5/12 = x/420#?...
1 answer
How would you determine the magnitude of the magnetic force on each of the four sides?
A square coil of wire containing a single turn is placed in a uniform #0.20 T# magnetic field, as the drawing shows. Each side has a length of #0.32 m#, and the current in the coil is #12 A#....
1 answer
Question1 What is the unbraced length of the Girder shown in the figure above 10 ft er wrong 15 ft Question2 TYPc what is the unbraced length of the Putins shown in fgure above? wrong 10 ft...
Question1 What is the unbraced length of the Girder shown in the figure above 10 ft er wrong 15 ft Question2 TYPc what is the unbraced length of the Putins shown in fgure above? wrong 10 ft oft 30 r Question3 Which one of the following is TRUE about the stability factor CL of the girder a) CL 1.0 ) ...
1 answer
1. [10] Given the declarations: signed char0x05, y 0x0A, z 0x2F: we are using 1 byte...
1. [10] Given the declarations: signed char0x05, y 0x0A, z 0x2F: we are using 1 byte 8 bits Evaluate each of the following. Give the answers as two hexadecimal characters a) 9 b) x-y c) x^y d) (x <<2) &z c) (x A y)loz) 2. [10] Suppose we are using a machine with that uses 7 bits to store a...
1 answer
Using JAVA FX how would I combine the two programs below into one interface that allows...
Using JAVA FX how would I combine the two programs below into one interface that allows the user to pick which specific program they would like to play. They should be able to choose which one they want to play and then switch between them if necesary. All of this must be done in JAVA FX code Black ...
1 answer
Problems 6 - 8: Suppose that the amount of coffee in each cup dispensed by a...
Problems 6 - 8: Suppose that the amount of coffee in each cup dispensed by a vending machine follows a normal distribution. A coffee vending machine is configured so that mean of all of the cups of coffee it dispenses is u = 12.0 ounces with a standard deviation o = 0.8 ounces. The mean of the distr...
1 answer
Page 5 of 7 4. With the aid of an illustration, explain in detail how Global...
Page 5 of 7 4. With the aid of an illustration, explain in detail how Global Positioning System determines the location using Triangulation and cite an example. Note: The source of your answer should be referred to properly: It is expected that you rephrase your answer based from your source.) (5 Ma...
1 answer
Based on the regression line above, what amount would you predict for local spending if a...
Based on the regression line above, what amount would you predict for local spending if a state spends $40 billion? What might be some reasons that using that prediction would give you hesitation? The data given in tab one can be used to compare education spending by state. We cannot use the data as...
1 answer
Need help with my crows foot notation on my visio diagram. Are my notations correct? If...
Need help with my crows foot notation on my visio diagram. Are my notations correct? If not, how should they be? Customers PK ID Purchase Orders Lineltems FirstName LastName StreetAddress City State Zip PK OrderID FK1 CustomerID Date PK,FK1 OrderlD PK LineNumber SubTotal ProductlD Quantity Extended...
1 answer
Fill in the name and empirical formula of each ionic compound that could be formed from...
Fill in the name and empirical formula of each ionic compound that could be formed from the ions in this table: some ionic compounds name of compound cation anion empirical formula Ро к Na 2 so Cu 3+ Fe Clo2 X...
1 answer
16. The nurse is testing the function of a mune is testing the function of CN...
16. The nurse is testing the function of a mune is testing the function of CN 30-year-old female She is e to feel the sensation on the Themenow that which of her CN is intact a) CNM b) CN IV c) CNV d) CN VII 17. The nurse is conducting a health history on a new client. The client presents with compl...
1 answer
An 80lb cabinet is mounted on frictionless casters which allow it to move freely on the...
An 80lb cabinet is mounted on frictionless casters which allow it to move freely on the floor. If a 50 lb force is applied as shown, determine the maximum value of h (in inches) to avoid tipping. 50 lb 35 in. 20 in....
1 answer
Write a 2-3-page paper addressing the following: Background of a clinical practice problem or educational problem...
Write a 2-3-page paper addressing the following: Background of a clinical practice problem or educational problem related to your practice. The PICO(T) format is used to organize research evidence to address clinical problems. You will use the PICO(T) question to identify relevant studies needed to...
1 answer
For the given table, if Direct Runoff depth is computed to be 101mm, determine the Runoff...
For the given table, if Direct Runoff depth is computed to be 101mm, determine the Runoff Coefficient, c. Express to the nearest 2 decimal digits. Time Observed Rainfall (mm) 9:00 43 9:30 53 10:00 5 10:30 5 11:00 11:30 12:00 12:30 13:00 13:30 14:00...
1 answer
Required information Use the following information for the Exercises below. The following information applies to the...
Required information Use the following information for the Exercises below. The following information applies to the questions displayed below) During April, the production department of a process manufacturing system completed a number of units of a product and transferred them to finished goods of...
1 answer
Jan 24, 2020 11:30 05 PM Question 4 Suppose an economist develops a theory that higher...
Jan 24, 2020 11:30 05 PM Question 4 Suppose an economist develops a theory that higher gas prices lead people to take more local vacations According to the scientific method, which of the following is the economist's next step? Devise another theory that contradicts the initial one Publish the t...
1 answer
The table below shows the number of state-registered automatic weapons and the murder rate for several...
The table below shows the number of state-registered automatic weapons and the murder rate for several Northwestern states. 11.5 8.4 6.7 3.6 2.8 2.8 2.1 0.5 y 13.6 11 9.5 6.9 6.2 6.5 6 4.8 I thousands of automatic weapons y = murders per 100,000 residents This data can be modeled by the equation y =...