@@ -1074,15 +1074,7 @@ This can be done intuitively like so:
10741074 df2[df2 < 0 ] = 0
10751075 df2
10761076
1077- By default, ``where `` returns a modified copy of the data. There is an
1078- optional parameter ``inplace `` so that the original data can be modified
1079- without creating a copy:
1080-
1081- .. ipython :: python
1082-
1083- df_orig = df.copy()
1084- df_orig.where(df > 0 , - df, inplace = True )
1085- df_orig
1077+ ``where `` returns a modified copy of the data.
10861078
10871079.. note ::
10881080
@@ -1239,18 +1231,6 @@ If instead you don't want to or cannot name your index, you can use the name
12391231 the index as ``ilevel_0 `` as well, but at this point you should consider
12401232 renaming your columns to something less ambiguous.
12411233
1242-
1243- The :class: `DataFrame.query ` method has a ``inplace `` keyword which determines
1244- whether the query modifies the original frame.
1245-
1246- .. ipython :: python
1247-
1248- df = pd.DataFrame(dict (a = range (5 ), b = range (5 , 10 )))
1249- df.query(" a > 2" )
1250- df.query(" a > 2" , inplace = True )
1251- df
1252-
1253-
12541234:class: `~pandas.MultiIndex ` :meth: `~pandas.DataFrame.query ` Syntax
12551235~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12561236
@@ -1635,7 +1615,7 @@ See :ref:`Advanced Indexing <advanced>` for usage of MultiIndexes.
16351615 ind = pd.Index([1 , 2 , 3 ])
16361616 ind.rename(" apple" )
16371617 ind
1638- ind.set_names([" apple" ], inplace = True )
1618+ ind = ind .set_names([" apple" ])
16391619 ind.name = " bob"
16401620 ind
16411621
@@ -1755,14 +1735,11 @@ the given columns to a MultiIndex:
17551735 frame = frame.set_index([' a' , ' b' ], append = True )
17561736 frame
17571737
1758- Other options in ``set_index `` allow you not drop the index columns or to add
1759- the index in-place (without creating a new object):
1738+ Other options in ``set_index `` allow you not drop the index columns.
17601739
17611740.. ipython :: python
17621741
17631742 data.set_index(' c' , drop = False )
1764- data.set_index([' a' , ' b' ], inplace = True )
1765- data
17661743
17671744 Reset the index
17681745~~~~~~~~~~~~~~~
0 commit comments