Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code must be done in python, The information will be given in the picture shown. Thank you. #You will find the two data sets

The code must be done in python, The information will be given in the picture shown. Thank you.
#You will find the two data sets that have the highest correlation (either negitive or positive) and then plot the data using a scatter plot.
#Then using the seaborn library, plot the regression line of the data.
#1.Create a function to read each colmn of Atmosphere Temperature, Soil Temperature, Atmosphere Humidity and Soil Humidity using the .values method from the numpy library.
#2.Pass the .values to a second function that will calculate and display the correlation coefficient of the two highest correlation values to the console.
#Choose any correlation method you wish. Good examples can be found in the second resrouce listed above. (there will be one negative and one positive correlation)
#(HINT: You may need to test different combinations to get the best correlations. i.e. Atm Hum vs Soil Hum, Atm Temp vs Soil Hum...etc.)*
#3.Pass the .values to a third function that will display a 2 scatter plots of the two data sets with a properly fit regression line.
#Label the plots with the appropriate title and label the x-axis and y-axis as well. Display the plots to the console and also include code to save the file to Plant_Corr.pdf.
#4.Create the main() function which calls all three functions. Don't forget to call main to kick it off!
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from scipy.stats import spearmanr as spr
import seaborn as sns
def read_to_values():
# Open the plant_data file for reading.
# Read all the lines from the file.
#### Fix Me ####
plant_file = pd.read_csv(????)
#create column value lists for plotting
atm_temp = plant_file['Atmosphere Temp'].values
#### Fix Me ####
#### Fix Me ####
#### Fix Me ####
#### Fix Me ####
return ????
#### Fix Me ####
def corr_calc(?,?,?,?):
#correlation calculation
#### Fix Me ####
#### Fix Me ####
# Print the result
print(f"\t\tCorrelation: {result:.0%}\t\t\tCorrelation: {result2:.0%}")
#### Fix Me ####
def plot_me(?,?,?,?):
#plot the data points and regression lines for neg and pos correlation
#### Fix Me ####
plt.tight_layout()
plt.savefig('drive/My Drive/Colab Notebooks/NEWEST 207/Plant_Corr.pdf')
plt.show()
# Create the main function.
def main():
#### Fix Me ####
????= read_to_values()
corr_calc(????)
plot_me(????)
# Call main function to kick it off!
#### Fix Me ####
????
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Compose the six common types of social business messages.

Answered: 1 week ago

Question

Describe positive and neutral messages.

Answered: 1 week ago