Question: I really need help on this soon! Thank you!! Using pandas in python, how would I 1. Find the average and standard deviation for each
I really need help on this soon! Thank you!!
Using pandas in python, how would I
1. Find the average and standard deviation for each of the maturities( maturity is 6-month, 1 year, etc.) that I already have downloaded using fred.
2. Pick only the rows that have value more or less than avg +/- 1 std
3. Make a dataframe which has only those rows for which all of the maturities has value outside of avg +/- 1 std. ** think about joining frames in step 2
4.Save the generated dataframe as fun.xlsx
There should be 7 rows left at the end, not counting the header
This is the code I have so far, which is correct so far:
import pandas_datareader.data as web import datetime as date fromDate ="2014-01-02" toDate = "2016-01-02" dfSixMo = web.DataReader('DGS6MO','fred',fromDate,toDate) dfOneYear = web.DataReader('DGS1','fred',fromDate,toDate) dfFiveYear = web.DataReader('DGS5','fred',fromDate,toDate) dfTenYear = web.DataReader('DGS10','fred',fromDate,toDate)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
