From 9682a9d8489fd64b5ce65ece8e96c0b738797bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 24 Dec 2021 12:00:00 +0100 Subject: [PATCH] Pandas --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 26d9f3b..98581c3 100644 --- a/README.md +++ b/README.md @@ -3204,8 +3204,8 @@ b 3 4 ```python = .set_index(column_key) # Replaces row keys with values from a column. = .reset_index() # Moves row keys to a column named index. - = .filter('', axis=1) # Only keeps columns whose key matches the regex. - = .melt(id_vars=column_key/s) # Converts DataFrame from wide to long format. + = .sort_index(ascending=True) # Sorts rows by row keys. + = .sort_values(column_key/s) # Sorts rows by the passed column/s. ``` #### Merge, Join, Concat: diff --git a/index.html b/index.html index 2fca51f..85c6492 100644 --- a/index.html +++ b/index.html @@ -2591,8 +2591,8 @@ b 3 4
<DF>    = <DF>.set_index(column_key)          # Replaces row keys with values from a column.
 <DF>    = <DF>.reset_index()                  # Moves row keys to a column named index.
-<DF>    = <DF>.filter('<regex>', axis=1)      # Only keeps columns whose key matches the regex.
-<DF>    = <DF>.melt(id_vars=column_key/s)     # Converts DataFrame from wide to long format.
+<DF>    = <DF>.sort_index(ascending=True)     # Sorts rows by row keys.
+<DF>    = <DF>.sort_values(column_key/s)      # Sorts rows by the passed column/s.
 

Merge, Join, Concat:

>>> l = DataFrame([[1, 2], [3, 4]], index=['a', 'b'], columns=['x', 'y'])
    x  y