PriceHistory.py
def view_historical_price(self, interval):
        """Return text description of the historical price.""" 
        self.interval = interval
        # view history for one day
        if self.interval == "one":             
            self.df_one = self.get_historical_price("one")
            # get a summary info of one day data frame
            # round all data to two decimal places
            df_info = self.df_one.describe().round(2)                        
            return ("\nPrice History on {}: \n"
                  "Open Price:  ${} \n"
                  "High Price:  ${} \n"
                  "Low Price:   ${} \n"
                  "Close Price: ${} \n"
                  "Volumn:      {:,.2f}"\
                  .format(self.view_date, df_info.iat[1,0], df_info.iat[1,1], \
                         df_info.iat[1,2], df_info.iat[1,3], df_info.iat[1,5]))
        
        # view history for a period        
        elif self.interval == "period":
            # get a summary info of a period data frame
            self.df_period = self.get_historical_price("period")
            df_info = self.df_period.describe().round(2)            
            return ("\nPrice History Summary from {} to {}: \n"
                  "                Max                Min               Mean\n"
                  "Open Price:   ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "High Price:   ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "Low Price:    ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "Close Price:  ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "Volumn:       {:<16,.2f}  {:<16,.2f}  {:<16,.2f}"\
                  .format(self.view_period[0], self.view_period[1], \
                      df_info.iat[7,0], df_info.iat[3,0], df_info.iat[1,0],\
                      df_info.iat[7,1], df_info.iat[3,1], df_info.iat[1,1],\
                      df_info.iat[7,2], df_info.iat[3,2], df_info.iat[1,2],\
                      df_info.iat[7,3], df_info.iat[3,3], df_info.iat[1,3],\
                      df_info.iat[7,5], df_info.iat[3,5], df_info.iat[1,5]))
Return text description of the historical price.
Return text description of the historical price.
Return text description of the historical price .
def view_historical_price(self, interval):
        self.interval = interval
        if self.interval == "one":             
            self.df_one = self.get_historical_price("one")
            df_info = self.df_one.describe().round(2)                        
            return ("\nPrice History on {}: \n"
                  "Open Price:  ${} \n"
                  "High Price:  ${} \n"
                  "Low Price:   ${} \n"
                  "Close Price: ${} \n"
                  "Volumn:      {:,.2f}"\
                  .format(self.view_date, df_info.iat[1,0], df_info.iat[1,1], \
                         df_info.iat[1,2], df_info.iat[1,3], df_info.iat[1,5]))
        elif self.interval == "period":
            self.df_period = self.get_historical_price("period")
            df_info = self.df_period.describe().round(2)            
            return ("\nPrice History Summary from {} to {}: \n"
                  "                Max                Min               Mean\n"
                  "Open Price:   ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "High Price:   ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "Low Price:    ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "Close Price:  ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n"
                  "Volumn:       {:<16,.2f}  {:<16,.2f}  {:<16,.2f}"\
                  .format(self.view_period[0], self.view_period[1], \
                      df_info.iat[7,0], df_info.iat[3,0], df_info.iat[1,0],\
                      df_info.iat[7,1], df_info.iat[3,1], df_info.iat[1,1],\
                      df_info.iat[7,2], df_info.iat[3,2], df_info.iat[1,2],\
                      df_info.iat[7,3], df_info.iat[3,3], df_info.iat[1,3],\
                      df_info.iat[7,5], df_info.iat[3,5], df_info.iat[1,5]))
def view_historical_price ( self , interval ) : self . interval = interval if self . interval == "one" : self . df_one = self . get_historical_price ( "one" ) df_info = self . df_one . describe ( ) . round ( 2 ) return ( "\nPrice History on {}: \n" "Open Price:  ${} \n" "High Price:  ${} \n" "Low Price:   ${} \n" "Close Price: ${} \n" "Volumn:      {:,.2f}" . format ( self . view_date , df_info . iat [ 1 , 0 ] , df_info . iat [ 1 , 1 ] , df_info . iat [ 1 , 2 ] , df_info . iat [ 1 , 3 ] , df_info . iat [ 1 , 5 ] ) ) elif self . interval == "period" : self . df_period = self . get_historical_price ( "period" ) df_info = self . df_period . describe ( ) . round ( 2 ) return ( "\nPrice History Summary from {} to {}: \n" "                Max                Min               Mean\n" "Open Price:   ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n" "High Price:   ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n" "Low Price:    ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n" "Close Price:  ${:<16.2f}  ${:<16.2f}  ${:<16.2f} \n" "Volumn:       {:<16,.2f}  {:<16,.2f}  {:<16,.2f}" . format ( self . view_period [ 0 ] , self . view_period [ 1 ] , df_info . iat [ 7 , 0 ] , df_info . iat [ 3 , 0 ] , df_info . iat [ 1 , 0 ] , df_info . iat [ 7 , 1 ] , df_info . iat [ 3 , 1 ] , df_info . iat [ 1 , 1 ] , df_info . iat [ 7 , 2 ] , df_info . iat [ 3 , 2 ] , df_info . iat [ 1 , 2 ] , df_info . iat [ 7 , 3 ] , df_info . iat [ 3 , 3 ] , df_info . iat [ 1 , 3 ] , df_info . iat [ 7 , 5 ] , df_info . iat [ 3 , 5 ] , df_info . iat [ 1 , 5 ] ) )
Return text description of the historical price.
Return text description of the historical price .
"""Return text description of the historical price.""" # view history for one day
 # get a summary info of one day data frame
 # round all data to two decimal places
 # view history for a period        
 # get a summary info of a period data frame

self
interval