File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
doc/source/getting_started/comparison/includes Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 33DataFrames can be filtered in multiple ways; the most intuitive of which is using
44:ref: `boolean indexing <indexing.boolean >`
55
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+
613 .. ipython :: python
714
815 tips[tips[" total_bill" ] > 10 ]
Original file line number Diff line number Diff line change 33The same operation in pandas can be accomplished using
44the ``where `` method from ``numpy ``.
55
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+
613 .. ipython :: python
714
815 tips[" bucket" ] = np.where(tips[" total_bill" ] < 10 , " low" , " high" )
Original file line number Diff line number Diff line change 33pandas objects have a :meth: `DataFrame.sort_values ` method, which
44takes a list of columns to sort by.
55
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+
613 .. ipython :: python
714
815 tips = tips.sort_values([" sex" , " total_bill" ])
Original file line number Diff line number Diff line change 11:orphan:
22
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+
310 .. ipython :: python
411
512 tips[" date1" ] = pd.Timestamp(" 2013-01-15" )
You can’t perform that action at this time.
0 commit comments