EADST

Pandas Dataframe Sum the Filtering Data

Pandas Dataframe Sum the Filtering Data 数据筛选后求和

# sum the index profit in May
df1 = data_frame[(data_frame['month'] == 5)]['profit'].sum()

# sum the index profit from May to July
df2 = data_frame[(data_frame['month']>=5) & (data_frame['month']<8)]['profit'].sum()

相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文242篇,共被浏览287749

本站已经建立1772天!

热门文章
文章归档
回到顶部