Delete redundant rows in pandas dataframe
import modulesimport pandas as pd Create dataframe with duplicatesraw_data = {'first_name': ['Jason', 'Jason', 'Tina', 'Jake', 'Amy'], 'last_name': ['Miller', 'Miller', 'Ali', 'Milner', 'Cooze'], 'age': [42, 42, 36, 24, 73], 'preTestScore': [4, 4, 31, 2, 3], 'postTestScore': [25, 25, 57, 62, 70]} df = pd.DataFrame(raw_data, columns = ['first_name', 'last_name', 'age', 'preTestScore', 'postTestSc..
더보기
볼린저밴드 구현하기 using python | Cal Bollinger bands using Python
파이썬을 이용해서 볼린저밴드 구현하기 Ver. 0.1def anaylize_bolllinger(df,dir_name,dest_path,date_list): df_normalize=df['Close']/df['Close'].ix[0,:] # Compute rolling mean,rolling standard deviation,upper and lower band of Bollinger rm=df['Close'].rolling(window=20,center=False).mean() rmstd=df['Close'].rolling(window=20,center=False).std() upper_band, lower_band = get_bollinger_bands(rm,rmstd) dp=df['Close'].ro..
더보기