
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.

작성한 코드 및 에러 메세지
df = fdr.DataReader('005930','2018')
df = df[['Close']]
df['ma'] = df.rolling(3).mean().shift(1)
df['action'] = np.where(df['Close'] > df['ma'], 'buy', 'sell')
df.iloc[-1,-1] = 'sell'
cond1 = (df['action'] == 'buy') & (df['action'].shift(1) == 'sell')
cond2 = (df['action'] == 'sell') & (df['action'].shift(1) == 'buy')
df_buy = df[cond1].reset_index()
df_buy.conlumns = ['날짜','종가(buy)', '이평값', '액션']
df_sell = df[cond2]
df_sell.conlumns = ['날짜','종가(sell)', '이평값', '액션']
df_result = pd.concat([df_buy,df_sell], axis =1)
df_result['수익']
