Project - Stock Closing Price Prediction using Deep Learning, TensorFlow2 & Keras

14 / 32

Getting the Dates of Missing Values

Let us see if the missing values are due to the official holidays of NYSE or due to some other unknown factors.

In case the dates are of official holidays, then those values can't be accounted for as missing. Else, we have to come up with ways to fill those missing values.

So first, let us first filter the null rows and get the dates of these missing values.

Note:

any() returns whether any element is True, potentially over an axis.

isnull().any(axis=1) returns a dataframe which contains null values along the rows.

df.index gets the indices of the data frame.

df.index.tolist() returns the list representation of the indexes of the data frame.

INSTRUCTIONS
  • Filter the rows with null values using isnull().any(axis=1) on the yahoo_data dataframe, and store the thus obtained dataframe in null_data.

    null_data = yahoo_data[yahoo_data. << your code comes here >> ]
    
  • View the head of the null_data data frame using head().

    << your code comes here >>.head()
    
  • Get the list representation of the dates of null_data using index.tolist() and store the list in the null_dates variable.

     your code comes here >> = null_data.<<  your code comes here >>
    
Get Hint See Answer


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...