Answer to Question #294040 in Python for suresh

Question #294040

1. Correlation between two variables X&Y is 0.85. Now, after adding the value 2 to all the values of X, the correlation co-efficient will be______

2. A) Read the given dataset “Tips.csv” as a dataframe “Data”. Give 3 commands to extract the columns in the following sequence - Time, TotalBill, Tips?

 

B)     Read the given excel sheet ‘Tips1.xlsx’ as a dataframe ‘Data1’. What command should be given to merge the two data frames ‘Data’ and ‘Data1’ by columns?

 

C)     Copy the 'Data1' dataframe as 'Data2' (Data2 = Data1.copy()) and identify the command to find the total tips received across Day’s from the dataframe ‘Data2’?

 




1
Expert's answer
2022-02-06T02:13:43-0500
#all needed lib are added
from numpy import mean
from numpy import std
from numpy.random import randn
from numpy.random import seed
from matplotlib import pyplot

seed(1)

data1 = 20 * randn(1000) + 100
data2 = data1 + (10 * randn(1000) + 50)
#for reading your data set
print('data1: mean=%.3f stdv=%.3f' % (mean(data1), std(data1)))
print('data2: mean=%.3f stdv=%.3f' % (mean(data2), std(data2)))

pyplot.scatter(data1, data2)
pyplot.show()

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