pandas.DataFrame.sort_values
DataFrame.sort_values(by, axis=0, ascending=True, inplace=False, kind=‘quicksort’, na_position=‘last’, ignore_index=False, key=None)[source]
Sort by the values along either axis.

Parameters
bystr or list of str
Name or list of names to sort by.

if axis is 0 or ‘index’ then by may contain index levels and/or column labels.

if axis is 1 or ‘columns’ then by may contain column levels and/or index labels.

axis{0 or ‘index’, 1 or ‘columns’}, default 0
Axis to be sorted.

ascendingbool or list of bool, default True
Sort ascending vs. descending. Specify list for multiple sort orders. If this is a list of bools, must match the length of the by.

inplacebool, default False
If True, perform operation in-place.

kind{‘quicksort’, ‘mergesort’, ‘heapsort’, ‘stable’}, default ‘quicksort’
Choice of sorting algorithm. See also numpy.sort() for more information. mergesort and stable are the only stable algorithms. For DataFrames, this option is only applied when sorting on a single column or label.

na_position{‘first’, ‘last’}, default ‘last’
Puts NaNs at the beginning if first; last puts NaNs at the end.

ignore_indexbool, default False
If True, the resulting axis will be labeled 0, 1, …, n - 1.

New in version 1.0.0.

keycallable, optional
Apply the key function to the values before sorting. This is similar to the key argument in the builtin sorted() function, with the notable difference that this key function should be vectorized. It should expect a Series and return a Series with the same shape as the input. It will be applied to each column in by independently.

New in version 1.1.0.

Returns
DataFrame or None
DataFrame with sorted values or None if inplace=True.

pandas里面已经是sort_values()啦相关推荐

  1. 媲美Pandas?一文入门Python的Datatable操作

    作者 | Parul Pandey 译者 | linstancy 责编 | Jane 出品 | Python大本营(id:pythonnews) [导读]工具包 datatable 的功能特征与 Pa ...

  2. 【Python】Pandas数据排序实现

    公众号:尤而小屋 作者:Peter 编辑:Peter 在以前的一篇文章   图解Pandas的排序机制sort_values   详细介绍了如何使用pandas的内置函数sort_values来实现数 ...

  3. 【Python】挑战SQL:图解Pandas的数据合并merge

    公众号:尤而小屋 作者:Peter 编辑:Peter 在实际的业务需求中,我们的数据可能存在于不同的库表中.很多情况下,我们需要进行多表的连接查询来实现数据的提取,通过SQL的join,比如left ...

  4. 你一定不能错过的pandas 1.0.0四大新特性

    文章来源于Python大数据分析,作者费弗里 本文对应脚本及数据已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1. ...

  5. python中的values函数_Pandas之排序函数sort_values()的实现

    一.sort_values()函数用途 pandas中的sort_values()函数原理类似于SQL中的order by,可以将数据集依照某个字段中的数据进行排序,该函数即可根据指定列数据也可根据指 ...

  6. pandas是一个基于什么的python库_Pandas库的介绍

    Pandas库的引用 Pandas是python第三方库,提供高性能易用数据类型和分析工具 import pandas as pd Pandas基于Numpy实现,常与Numpy和Matplotlib ...

  7. 熊猫直播 使用什么sdk_没什么可花的-但是16项基本操作才能让您开始使用熊猫

    熊猫直播 使用什么sdk Python has become the go-to programming language for many data scientists and machine l ...

  8. 数据科学家令人惊叹的排序技巧

    2019 年第 80 篇文章,总第 104 篇文章 本文大约 7800 字,阅读大约需要20分钟 原题 | Surprising Sorting Tips for Data Scientists 作者 ...

  9. python天气预测算法_使用机器学习预测天气(第二部分)

    概述 这篇文章我们接着前一篇文章,使用Weather Underground网站获取到的数据,来继续探讨用机器学习的方法预测内布拉斯加州林肯市的天气 上一篇文章我们已经探讨了如何收集.整理.清洗数据. ...

最新文章

  1. 《梦断代码Dreaming In Code》阅读笔记(三)
  2. An Openfire plugin for Webspell sites.
  3. RabbitMq queue异常导致consumer停止
  4. javascript --- 手写Promise、快排、冒泡、单例模式+观察者模式
  5. java 静态代码块_JAVA静态代码块
  6. 一行代码能做什么? 看到最后一个我终于忍不住...
  7. LOJ#3085. 「GXOI / GZOI2019」特技飞行(KDtree+坐标系变换)
  8. no symbol version section for versioned symbol `memcpy@GLIBC_2.4'
  9. 移动通信技术的未来发展趋势分析
  10. 吉哥系列故事——礼尚往来
  11. 【与奥斯丁的二十种邂逅】-- 得克萨斯首府的小情调城市游 (介绍你在奥斯丁必须做的,推荐做的,和做了你就牛掰了的20件事)...
  12. 华三防火墙安全策略配置
  13. 学计算机用华硕电脑,适合大学生使用的最佳笔记本电脑推荐,华硕 ZenBook UX330UA...
  14. MCE公司:RIP1 激酶抑制剂可应用于自身免疫性脑脊髓炎的治疗
  15. 机场生产运行数据统计指标-第一篇-总述
  16. 什么邮箱群发进箱率高,邮箱怎么群发邮件进箱率怎么样?
  17. 分布式数据库TiDB介绍
  18. 阿里开源的10个神级项目
  19. 学习使用js链接websocket服务断线重连的方法
  20. matlab视网膜血管分割,视网膜血管增强与分割算法研究

热门文章

  1. Python requests 笔记(一)
  2. qt使用 QMediaPlay 简单播放音乐
  3. signature=c58a3c5e53e2eed44d09cd8589207f96,合同英语
  4. 信息系统项目管理师需要准备多久?备考技巧分享
  5. 信息系统项目管理师-信息系统成本管理核心知识点思维脑图
  6. C#中全局作用域的常量、字段、属性、方法的定义与使用
  7. Eclipse导入项目后中文乱码
  8. Netty4服务端和客户端实现
  9. SOA和微服务之间的区别(应用和数据的垂直拆分水平拆分)
  10. 全球化、文化和团队多样性