The code is to retrieve the corresponding friday data for a given stock dataframe. I believe the code works as intended but I figure there was a more effective way for time