Answer to Question #308436 in Python for Akash

Question #308436

You work in XYZ Corporation as a Data Analyst. Your corporation has told you to work with the statistics. 


1. Create a table in excel, table should have 2 columns named x and y.

a. ‘x’ column should have numbers from 1-5.

b. ‘y’ should have numbers 2,4,5,4,2

c. Now calculate the mean of columns x and y.

d. Calculate the mode of column x.

e. Calculate the standard deviation of column y.

f. Atlast calculate the range of columns x and y separately


1
Expert's answer
2022-03-09T06:39:31-0500
import pandas as pd
import numpy as np
import os


df = pd.read_csv("Data.csv")
print(df)


u = np.array(df['x'])
v = np.array(df['y'])
print("Mean of column X: ",np.mean(u))
print("Mean of column Y: ",np.mean(v))


print("Mode: ")
print(df.mode())


print("Standard Deviationof column Y: ",round(np.std(v),2))


print("Range of column X: ",np.min(u),"to",np.max(u))
print("Range of column Y: ",np.min(v),"to",np.max(v))




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS