Home  >  Article  >  Backend Development  >  How to sort a series in Python

How to sort a series in Python

(*-*)浩
(*-*)浩Original
2019-07-05 14:41:0411091browse

SERIES is a special function used to define chart series, it can only be used in such an environment.

How to sort a series in Python

#series (function curve) In all chart types except bubble charts, the SERIES function has the parameters listed in the following table. (Recommended learning: Python video tutorial)

In the bubble chart, the SERIES function also uses an additional parameter to specify the size of the bubble.

Linear data structure, series is a one-dimensional array

Pandas will silently use 0 to n-1 as the index of the series, but you can also specify the index yourself (index can be understood as key in dict)

Sort Series

It is divided into index sorting and value sorting

sort_index method

seriesdata.sort_index()
seriesdata.sort_index(ascending = False, inpalce = False)

sort_values ​​method

seriesdata.sort_values()
seriesdata.sort_values(ascending = False, inpalce = False)

For more Python related technical articles, please visit the Python Tutorial column to learn!

The above is the detailed content of How to sort a series in Python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn