Sorted in alphabetical order of month.Seems to be default.To get sorted by date…got to use sort_index
Hi, I am also getting the same result despite being Sunday is a non working day for the stock market then how the mean can be computed for the 6th weekday ?
Can anyone help ?
For problem 6 (#On the days in which NIFTY50 closed higher than the open, what was the mean of(close-open)for NIFTYNext50), this is what i have done. can anyone confirm if this is correct? i am getting mean as 118.70188679245271
if ((x.NIFTY50.Close - x.NIFTY50.Open) > 0):
df5[‘NIFTY50’,‘Diff’] = df5.apply(difference, axis=1)
df5[‘NIFTYNEXT50’,‘Diff1’] = (df5.NIFTYNEXT50.Close) - (df5.NIFTYNEXT50.Open)
df5 = df5.sort_index(axis=1)
df_5 = df5[(df5.NIFTY50.Diff) == True]
#In 2019, on how many days did the day’s close exceed the 30 day moving average in NIFTY50(exclude first month) and i am getting answer as follows. can someone confirm if this is correct?
df2[‘Close_MA’] = df2[‘Close’] > df2[‘MA’]
Name: Close_MA, dtype: int64
There are several post above you can refer for solution to 8.
My soln: Solutions for Week 10 Pandas FDS
Refer to my notebook on GitHub for solution of final problem and please contribute with better code or any error correction if noticed.
Unable to find the GitHub page