Question: I need to the following answered with the corresponding code for Python. 1) Find the best cureve that fits the data points from the equation
I need to the following answered with the corresponding code for Python.
1) Find the best cureve that fits the data points from the equation below, with the best fit coeffints ([w]) and interception(b).
$$
\begin{equation}
y = -0.5 + 2.2 \times x + 0.3 \times x^3+ 2 \times N
\end{equation}
$$
N = 100 random numbers that follow normal distribution
x = 100 numbers evenly spaced between (-5,5)
Print your coefficeint(s) and intercept.
Plot a smooth predicted line from your fitted model together with the observed data points from the equation above, the line and the points should be in different colors.
Hint: 2 X N is introducing some tiny noise into the data.
2) Make a $10\times 4$ dataframe with random numbers that follows normal distribution. You can use any labels for index and column names. Check the first row, print all the column(s) where the values in the first row is greater than 0.
3) Make a dataframe that the index is the first date of each month in 2019, and the coloumn names are five students: Amy, Chris, Larry, Nancy and Zach. The values in the dataframe random integer values between 0 and 100. Show all values of Chris and Nancy for April to July 2019.
4) Use the same dataframe from 3,Display all rows of the dataframe where Amy > Zach.
5) Import the attached excel sheet named 'Employees.xls' and make another dataframe to show: under each manager ID, for each job title, what the total leave hours are. If the leave hour is Nan, replace it with a 0. Save the new table into a new excel sheet called 'LeaveHours_by_manger_and_job.xls'. You dont need to show your folder in your submission but only need to show the code for saving the file in the last step.
Hint: each distinct Manager ID should be a column name.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
