파이썬/Pandas(2)
-
[Python] series to dataframe row , why pd concat not append row
[Python] series to dataframe row , why pd concat not append row 여러개의 series데이터를 dataframe의 row로 append해야하는 상황 insert_df = pd.DataFrame() df.columns = range(df.columns.size) for idx,row in df.iterrows(): if idx % 12 ==0: try: insert_df= insert_df = pd.concat([insert_df,df.iloc[idx+9]], axis=0) except Exception as e: print(e) pass insert_df 반복문을 돌면서 Dataframe에 concat시키려고 했는데 열로 들어가는 문제가 발생했다.. Ser..
2022.07.01 -
[DataFrame] 중간에 빈 열 추가
[DataFrame] 중간에 빈 열 추가 # 중간에 빈 열 추가 sol_hist.insert(2,'hour',"") 2번째 열에 hour 컬럼명을 가진 빈 열 추가
2022.04.27