解决DataFrame排序sort的问题

yipeiwu_com6年前Python基础

如下所示:

result = result.T.sort(['confidence','support'], ascending = False)

报以下错误:

AttributeError: 'DataFrame' object has no attribute 'sort'

解决方式:

sort_values()即可解决

以上这篇解决DataFrame排序sort的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【听图阁-专注于Python设计】。

相关文章

Python内置的字符串处理函数详细整理(覆盖日常所用)

str='python String function' 生成字符串变量str='python String function' 字符串长度获取:len(str) 例:print '%s...

《Python之禅》中对于Python编程过程中的一些建议

《Python之禅》中对于Python编程过程中的一些建议

围绕一门语言,学习它的文化精髓,能让你成为一名更优秀的程序员。如果你还没读过Python之禅(Zen of Python) ,那么打开Python的命令提示符输入import this,...

Python 项目转化为so文件实例

Python 项目转化为so文件实例

思路是先将py转换为c代码,然后编译c为so文件,所以要安装以下内容: python 安装:cython pip install cython linux 安装:python-de...

对python中的os.getpid()和os.fork()函数详解

如下所示: import os import sys import time processNmae = 'parent' print "Program executing...

使用Python操作FTP实现上传和下载的方法

搭建ftp服务器server端 # -*- coding:utf-8 -*- from pyftpdlib.authorizers import DummyAuthorizer fr...