You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
np.random.seed(0)
df1=pd.DataFrame(np.random.randint(1,15,size=(2,6)),columns=[i for i in range(1,7)],index=['매출','비용'])
df2=pd.DataFrame(np.random.randint(1,20,size=(2,6)),columns=[i for i in range(7,13)],index=['매출','비용'])
df3=pd.concat([df1,df2],axis=1)
df3.loc['이익']=df3.apply(lambda x:int(x.loc['매출'])-int(x.loc['비용']))
df3['총실적']=[sum(df3.loc['매출']),sum(df3.loc['비용']),sum(df3.loc['이익'])]
df3
4.6 데이터프레임 합성 — 데이터 사이언스 스쿨
https://datascienceschool.net/01%20python/04.06%20%EB%8D%B0%EC%9D%B4%ED%84%B0%ED%94%84%EB%A0%88%EC%9E%84%20%ED%95%A9%EC%84%B1.html
The text was updated successfully, but these errors were encountered: