位置:- 正文

python中DataFrame的运算总结(python中dataframe的布尔过滤)

编辑:rootadmin

推荐整理分享python中DataFrame的运算总结(python中dataframe的布尔过滤),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:python中dataframe的布尔过滤,python中dataframe的布尔过滤,python dataframe fillna,python中dataframe的作用,python dataframe,python中dataframe的作用,python中dataframe的数字变成0,python中dataframe的作用,内容如对您有帮助,希望把文章链接给更多的朋友!

1、算术运算

data["open"].add(3).head()#open统一加3data["open"]+3data.sub(100).head()#所有统一减100data-100data["close"].sub(data["open"]).head()#close减openpython中DataFrame的运算总结(python中dataframe的布尔过滤)

2、逻辑运算

query(expr) expr:查询字符串

isin(values) 判断是否为values

data[data["p_change"]>2].head()#p_change>2data[(data["p_change"]>2)&(data["low"]>15)].head()data.query("p_change>2&low>15").head()#判断'turnover'是否为4.19,2.39data[data["turnover"].isin([4.19,2.39])]

3、统计运算

describe()

能够直接得出很多统计结果,count,mean,std,min,max等。

data.describe()data.max(axis=0)data.idxmax(axis=0)#值位置
本文链接地址:https://www.jiuchutong.com/zhishi/310464.html 转载请保留说明!
下一篇链接:https://www.jiuchutong.com/zhishi/310465.html
免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络