We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed629c4 commit 22b2475Copy full SHA for 22b2475
doc/source/getting_started/comparison/includes/column_selection.rst
@@ -1,13 +1,23 @@
1
The same operations are expressed in pandas below. Note that these operations do not happen in
2
place. To make these changes persist, assign the operation back to a variable.
3
4
+Keep certain columns
5
+''''''''''''''''''''
6
+
7
.. ipython:: python
8
- # keep
9
tips[["sex", "total_bill", "tip"]]
10
- # drop
11
+Drop a column
12
+'''''''''''''
13
14
+.. ipython:: python
15
16
tips.drop("sex", axis=1)
17
- # rename
18
+Rename a column
19
+'''''''''''''''
20
21
22
23
tips.rename(columns={"total_bill": "total_bill_2"})
0 commit comments