@@ -1779,7 +1779,7 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
1779
1779
avoid duplicating data
1780
1780
method : {None, 'backfill'/'bfill', 'pad'/'ffill', 'nearest'}, optional
1781
1781
method to use for filling holes in reindexed DataFrame.
1782
- Please note: this is only applicable to DataFrames/Series with a
1782
+ Please note: this is only applicable to DataFrames/Series with a
1783
1783
monotonically increasing/decreasing index.
1784
1784
* default: don't fill gaps
1785
1785
* pad / ffill: propagate last valid observation forward to next valid
@@ -1822,7 +1822,7 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
1822
1822
1823
1823
Create a new index and reindex the dataframe. By default
1824
1824
values in the new index that do not have corresponding
1825
- records in the dataframe are assigned ``NaN``.
1825
+ records in the dataframe are assigned ``NaN``.
1826
1826
1827
1827
>>> new_index= ['Safari', 'Iceweasel', 'Comodo Dragon', 'IE10',
1828
1828
... 'Chrome']
@@ -1836,8 +1836,8 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
1836
1836
1837
1837
We can fill in the missing values by passing a value to
1838
1838
the keyword ``fill_value``. Because the index is not monotonically
1839
- increasing or decreasing, we cannot use arguments to the keyword
1840
- ``method`` to fill the ``NaN`` values.
1839
+ increasing or decreasing, we cannot use arguments to the keyword
1840
+ ``method`` to fill the ``NaN`` values.
1841
1841
1842
1842
>>> df.reindex(new_index, fill_value=0)
1843
1843
http_status response_time
@@ -1855,8 +1855,8 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
1855
1855
IE10 404 0.08
1856
1856
Chrome 200 0.02
1857
1857
1858
- To further illustrate the filling functionality in
1859
- ``reindex``, we will create a dataframe with a
1858
+ To further illustrate the filling functionality in
1859
+ ``reindex``, we will create a dataframe with a
1860
1860
monotonically increasing index (for example, a sequence
1861
1861
of dates).
1862
1862
@@ -1873,7 +1873,7 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
1873
1873
2010-01-06 88
1874
1874
1875
1875
Suppose we decide to expand the dataframe to cover a wider
1876
- date range.
1876
+ date range.
1877
1877
1878
1878
>>> date_index2 = pd.date_range('12/29/2009', periods=10, freq='D')
1879
1879
>>> df2.reindex(date_index2)
@@ -1890,10 +1890,10 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
1890
1890
2010-01-07 NaN
1891
1891
1892
1892
The index entries that did not have a value in the original data frame
1893
- (for example, '2009-12-29') are by default filled with ``NaN``.
1893
+ (for example, '2009-12-29') are by default filled with ``NaN``.
1894
1894
If desired, we can fill in the missing values using one of several
1895
- options.
1896
-
1895
+ options.
1896
+
1897
1897
For example, to backpropagate the last valid value to fill the ``NaN``
1898
1898
values, pass ``bfill`` as an argument to the ``method`` keyword.
1899
1899
@@ -1911,7 +1911,7 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
1911
1911
2010-01-07 NaN
1912
1912
1913
1913
Please note that the ``NaN`` value present in the original dataframe
1914
- (at index value 2010-01-03) will not be filled by any of the
1914
+ (at index value 2010-01-03) will not be filled by any of the
1915
1915
value propagation schemes. This is because filling while reindexing
1916
1916
does not look at dataframe values, but only compares the original and
1917
1917
desired indexes. If you do want to fill in the ``NaN`` values present
0 commit comments