''' Write me a python code to find stocks above their 50 day moving average ''' import pandas as pd # Read in historical stock data from CSV file df = pd.read_csv('stock_data.csv', parse_dates=['date']) df = df.set_index('date') # Calculate 50 day moving average ma_50 = df['close'].rolling(window=50).mean() # Filter for stocks above 50 day moving average above_ma_50 = df[df['close'] > ma_50] # Print the filtered results print(above_ma_50)