[英]Python: how to rename dataframe with column names in tuple?
I have the dataframe below我下面有 dataframe
Col1/sum/mean Col2/sum/mean Col3/sum/mean
A 1 2 3
B 4 5 6
C 7 8 9
I find it annoying to access the column by doing df[('Col1','sum','mean')]
everytime, is there a way to remove the sum
and mean
levels?我发现每次都通过df[('Col1','sum','mean')]
访问该列很烦人,有没有办法删除sum
和mean
水平? Or rename it?还是重命名?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.