def clean(self, data):
        """Method returns cleaned list of stock closing prices
        (i.e. dict(date=datetime.date(2015, 1, 2), price='23.21'))."""
        cleaned_data = list()

        if not isinstance(data, list):
            data = [data]

        for item in data:
            date = datetime.datetime.strptime(item['Date'], '%Y-%m-%d').date()
            cleaned_data.append(dict(price=item['Adj_Close'], date=date))

        return cleaned_data
def clean ( self , data ) : cleaned_data = list ( ) if not isinstance ( data , list ) : data = [ data ] for item in data : date = datetime . datetime . strptime ( item [ 'Date' ] , '%Y-%m-%d' ) . date ( ) cleaned_data . append ( dict ( price = item [ 'Adj_Close' ] , date = date ) ) return cleaned_data
Method returns cleaned list of stock closing prices
        (i.e. dict(date=datetime.date(2015, 1, 2), price='23.21')).