当前位置:网站首页>How does dataframe calculate the average value of each row as another column
How does dataframe calculate the average value of each row as another column
2022-07-04 07:27:00 【Just want to be a migrant worker】
You can use the following code to calculate .
df['Col_sum'] = df.apply(lambda x: x.sum(), axis=1)
In addition, how to calculate the average value of each column as another row
df.loc['Row_sum'] = df.apply(lambda x: x.sum())
Of course , This method can be used to calculate variance and other statistical data , For example, to calculate variance, just replace it with x.std() That's it .
边栏推荐
- BibTex中参考文献种类
- There is no Chinese prompt below when inputting text in win10 Microsoft Pinyin input method
- Basic DOS commands
- 2022 - 021arts: début du deuxième semestre
- [FreeRTOS] FreeRTOS learning notes (7) - handwritten FreeRTOS two-way linked list / source code analysis
- Vulhub vulnerability recurrence 77_ zabbix
- What is the use of cloud redis? How to use cloud redis?
- Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
- Jianmu continuous integration platform v2.2.2 release
- Review of enterprise security incidents: how can enterprises do a good job in preventing source code leakage?
猜你喜欢
Chain ide -- the infrastructure of the metauniverse
Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
It's healthy to drink medicinal wine like this. Are you drinking it right
Rhcsa day 3
Take you to master the formatter of visual studio code
Su Weijie, a member of Qingyuan Association and an assistant professor at the University of Pennsylvania, won the first Siam Youth Award for data science, focusing on privacy data protection, etc
节点基础~节点操作
Transition technology from IPv4 to IPv6
SQL foundation 9 [grouping data]
NLP literature reading summary
随机推荐
Enter the year, month, and determine the number of days
CMS source code of multi wechat management system developed based on thinkphp6, with one click curd and other functions
Zabbix agent主动模式的实现
[Mori city] random talk on GIS data (I)
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Design of test cases
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
The IP bound to the socket is inaddr_ The meaning of any htonl (inaddr_any) (0.0.0.0 all addresses, uncertain addresses, arbitrary addresses)
kubernetes集群之Label管理
Summary of MySQL common judgment functions!! Have you used it
Campus network problems
In the era of low code development, is it still needed?
2022 - 021arts: début du deuxième semestre
Cell reports: Wei Fuwen group of the Institute of zoology, Chinese Academy of Sciences analyzes the function of seasonal changes in the intestinal flora of giant pandas
Blog stop statement
The number of patent applications in China has again surpassed that of the United States and Japan, ranking first in the world for 11 consecutive years
"Sword finger offer" 2nd Edition - force button brush question
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
MySQL 数据库 - 函数 约束 多表查询 事务
jdbc连接es查询的时候,有遇到下面这种情况的大神嘛?