File tree 4 files changed +28
-0
lines changed
doc/source/getting_started/comparison/includes
4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 3
3
DataFrames can be filtered in multiple ways; the most intuitive of which is using
4
4
:ref: `boolean indexing <indexing.boolean >`
5
5
6
+ .. ipython :: python
7
+ :suppress:
8
+
9
+ # ensure tips is defined when scanning with flake8-rst
10
+ if ' tips' not in vars ():
11
+ tips = {}
12
+
6
13
.. ipython :: python
7
14
8
15
tips[tips[" total_bill" ] > 10 ]
Original file line number Diff line number Diff line change 3
3
The same operation in pandas can be accomplished using
4
4
the ``where `` method from ``numpy ``.
5
5
6
+ .. ipython :: python
7
+ :suppress:
8
+
9
+ # ensure tips is defined when scanning with flake8-rst
10
+ if ' tips' not in vars ():
11
+ tips = {}
12
+
6
13
.. ipython :: python
7
14
8
15
tips[" bucket" ] = np.where(tips[" total_bill" ] < 10 , " low" , " high" )
Original file line number Diff line number Diff line change 3
3
pandas objects have a :meth: `DataFrame.sort_values ` method, which
4
4
takes a list of columns to sort by.
5
5
6
+ .. ipython :: python
7
+ :suppress:
8
+
9
+ # ensure tips is defined when scanning with flake8-rst
10
+ if ' tips' not in vars ():
11
+ tips = {}
12
+
6
13
.. ipython :: python
7
14
8
15
tips = tips.sort_values([" sex" , " total_bill" ])
Original file line number Diff line number Diff line change 1
1
:orphan:
2
2
3
+ .. ipython :: python
4
+ :suppress:
5
+
6
+ # ensure tips is defined when scanning with flake8-rst
7
+ if ' tips' not in vars ():
8
+ tips = {}
9
+
3
10
.. ipython :: python
4
11
5
12
tips[" date1" ] = pd.Timestamp(" 2013-01-15" )
You can’t perform that action at this time.
0 commit comments