UPDATE
Since 0.17.0
order
and sort
have been deprecated (thanks @Ruggero Turra), you can use sort_values
to achieve this now:
In[16]:
df.reindex(df.b.abs().sort_values().index)
Out[16]:
a b
2 3 -1
3 4 2
0 1 -3
1 2 5
4 5 -9
More Related Contents:
- how to sort pandas dataframe from one column
- Why does my Pandas DataFrame not display new order using `sort_values`?
- Sort a pandas dataframe series by month name
- Find the unique values in a column and then sort them
- Python – Delete duplicates in a dataframe based on two columns combinations?
- Pandas DataFrame sort by categorical column but by specific class ordering
- How to sort pandas data frame using values from several columns?
- Multi Index Sorting in Pandas
- How to identify and label similar rows in a pandas data frame
- Renaming column names in Pandas
- How can I use the apply() function for a single column?
- Pandas filtering for multiple substrings in series
- Filtering Pandas DataFrames on dates
- Python pandas insert list into a cell
- Pandas DataFrame Groupby two columns and get counts
- How can I map True/False to 1/0 in a Pandas DataFrame?
- Selection with .loc in python
- Pandas select rows and columns based on boolean condition
- How to flatten a hierarchical index in columns
- How can I subclass a Pandas DataFrame?
- Add a sequential counter column on groups to a pandas dataframe
- Pandas: Shift down values by one row within a group
- Pretty print a pandas dataframe in VS Code
- dataframe to dict such that one column is the key and the other is the value [duplicate]
- Custom sorting with Pandas
- Transpose the data in a column every nth rows in PANDAS
- Python: How to drop a row whose particular column is empty/NaN?
- Combine Pandas data frame column values into new column
- DataFrame object has no attribute append
- Python Pandas : pandas.to_datetime() is switching day & month when day is less than 13