def reindex(self, *args, **kwargs):
    '\n        Conform %(klass)s to new index with optional filling logic, placing\n        NA/NaN in locations having no value in the previous index. A new object\n        is produced unless the new index is equivalent to the current one and\n        ``copy=False``.\n\n        Parameters\n        ----------\n        %(optional_labels)s\n        %(axes)s : array-like, optional\n            New labels / index to conform to, should be specified using\n            keywords. Preferably an Index object to avoid duplicating data\n        %(optional_axis)s\n        method : {None, \'backfill\'/\'bfill\', \'pad\'/\'ffill\', \'nearest\'}\n            Method to use for filling holes in reindexed DataFrame.\n            Please note: this is only applicable to DataFrames/Series with a\n            monotonically increasing/decreasing index.\n\n            * None (default): don\'t fill gaps\n            * pad / ffill: propagate last valid observation forward to next\n              valid\n            * backfill / bfill: use next valid observation to fill gap\n            * nearest: use nearest valid observations to fill gap\n\n        copy : bool, default True\n            Return a new object, even if the passed indexes are the same.\n        level : int or name\n            Broadcast across a level, matching Index values on the\n            passed MultiIndex level.\n        fill_value : scalar, default np.NaN\n            Value to use for missing values. Defaults to NaN, but can be any\n            "compatible" value.\n        limit : int, default None\n            Maximum number of consecutive elements to forward or backward fill.\n        tolerance : optional\n            Maximum distance between original and new labels for inexact\n            matches. The values of the index at the matching locations most\n            satisfy the equation ``abs(index[indexer] - target) <= tolerance``.\n\n            Tolerance may be a scalar value, which applies the same tolerance\n            to all values, or list-like, which applies variable tolerance per\n            element. List-like includes list, tuple, array, Series, and must be\n            the same size as the index and its dtype must exactly match the\n            index\'s type.\n\n            .. versionadded:: 0.21.0 (list-like tolerance)\n\n        Returns\n        -------\n        %(klass)s with changed index.\n\n        See Also\n        --------\n        DataFrame.set_index : Set row labels.\n        DataFrame.reset_index : Remove row labels or move them to new columns.\n        DataFrame.reindex_like : Change to same indices as other DataFrame.\n\n        Examples\n        --------\n\n        ``DataFrame.reindex`` supports two calling conventions\n\n        * ``(index=index_labels, columns=column_labels, ...)``\n        * ``(labels, axis={\'index\', \'columns\'}, ...)``\n\n        We *highly* recommend using keyword arguments to clarify your\n        intent.\n\n        Create a dataframe with some fictional data.\n\n        >>> index = [\'Firefox\', \'Chrome\', \'Safari\', \'IE10\', \'Konqueror\']\n        >>> df = pd.DataFrame({\n        ...      \'http_status\': [200,200,404,404,301],\n        ...      \'response_time\': [0.04, 0.02, 0.07, 0.08, 1.0]},\n        ...       index=index)\n        >>> df\n                   http_status  response_time\n        Firefox            200           0.04\n        Chrome             200           0.02\n        Safari             404           0.07\n        IE10               404           0.08\n        Konqueror          301           1.00\n\n        Create a new index and reindex the dataframe. By default\n        values in the new index that do not have corresponding\n        records in the dataframe are assigned ``NaN``.\n\n        >>> new_index= [\'Safari\', \'Iceweasel\', \'Comodo Dragon\', \'IE10\',\n        ...             \'Chrome\']\n        >>> df.reindex(new_index)\n                       http_status  response_time\n        Safari               404.0           0.07\n        Iceweasel              NaN            NaN\n        Comodo Dragon          NaN            NaN\n        IE10                 404.0           0.08\n        Chrome               200.0           0.02\n\n        We can fill in the missing values by passing a value to\n        the keyword ``fill_value``. Because the index is not monotonically\n        increasing or decreasing, we cannot use arguments to the keyword\n        ``method`` to fill the ``NaN`` values.\n\n        >>> df.reindex(new_index, fill_value=0)\n                       http_status  response_time\n        Safari                 404           0.07\n        Iceweasel                0           0.00\n        Comodo Dragon            0           0.00\n        IE10                   404           0.08\n        Chrome                 200           0.02\n\n        >>> df.reindex(new_index, fill_value=\'missing\')\n                      http_status response_time\n        Safari                404          0.07\n        Iceweasel         missing       missing\n        Comodo Dragon     missing       missing\n        IE10                  404          0.08\n        Chrome                200          0.02\n\n        We can also reindex the columns.\n\n        >>> df.reindex(columns=[\'http_status\', \'user_agent\'])\n                   http_status  user_agent\n        Firefox            200         NaN\n        Chrome             200         NaN\n        Safari             404         NaN\n        IE10               404         NaN\n        Konqueror          301         NaN\n\n        Or we can use "axis-style" keyword arguments\n\n        >>> df.reindex([\'http_status\', \'user_agent\'], axis="columns")\n                   http_status  user_agent\n        Firefox            200         NaN\n        Chrome             200         NaN\n        Safari             404         NaN\n        IE10               404         NaN\n        Konqueror          301         NaN\n\n        To further illustrate the filling functionality in\n        ``reindex``, we will create a dataframe with a\n        monotonically increasing index (for example, a sequence\n        of dates).\n\n        >>> date_index = pd.date_range(\'1/1/2010\', periods=6, freq=\'D\')\n        >>> df2 = pd.DataFrame({"prices": [100, 101, np.nan, 100, 89, 88]},\n        ...                    index=date_index)\n        >>> df2\n                    prices\n        2010-01-01   100.0\n        2010-01-02   101.0\n        2010-01-03     NaN\n        2010-01-04   100.0\n        2010-01-05    89.0\n        2010-01-06    88.0\n\n        Suppose we decide to expand the dataframe to cover a wider\n        date range.\n\n        >>> date_index2 = pd.date_range(\'12/29/2009\', periods=10, freq=\'D\')\n        >>> df2.reindex(date_index2)\n                    prices\n        2009-12-29     NaN\n        2009-12-30     NaN\n        2009-12-31     NaN\n        2010-01-01   100.0\n        2010-01-02   101.0\n        2010-01-03     NaN\n        2010-01-04   100.0\n        2010-01-05    89.0\n        2010-01-06    88.0\n        2010-01-07     NaN\n\n        The index entries that did not have a value in the original data frame\n        (for example, \'2009-12-29\') are by default filled with ``NaN``.\n        If desired, we can fill in the missing values using one of several\n        options.\n\n        For example, to back-propagate the last valid value to fill the ``NaN``\n        values, pass ``bfill`` as an argument to the ``method`` keyword.\n\n        >>> df2.reindex(date_index2, method=\'bfill\')\n                    prices\n        2009-12-29   100.0\n        2009-12-30   100.0\n        2009-12-31   100.0\n        2010-01-01   100.0\n        2010-01-02   101.0\n        2010-01-03     NaN\n        2010-01-04   100.0\n        2010-01-05    89.0\n        2010-01-06    88.0\n        2010-01-07     NaN\n\n        Please note that the ``NaN`` value present in the original dataframe\n        (at index value 2010-01-03) will not be filled by any of the\n        value propagation schemes. This is because filling while reindexing\n        does not look at dataframe values, but only compares the original and\n        desired indexes. If you do want to fill in the ``NaN`` values present\n        in the original dataframe, use the ``fillna()`` method.\n\n        See the :ref:`user guide <basics.reindexing>` for more.\n        '
    (axes, kwargs) = self._construct_axes_from_arguments(args, kwargs)
    method = missing.clean_reindex_fill_method(kwargs.pop('method', None))
    level = kwargs.pop('level', None)
    copy = kwargs.pop('copy', True)
    limit = kwargs.pop('limit', None)
    tolerance = kwargs.pop('tolerance', None)
    fill_value = kwargs.pop('fill_value', None)
    kwargs.pop('axis', None)
    if kwargs:
        raise TypeError('reindex() got an unexpected keyword argument "{0}"'.format(list(kwargs.keys())[0]))
    self._consolidate_inplace()
    if all((self._get_axis(axis).identical(ax) for (axis, ax) in axes.items() if (ax is not None))):
        if copy:
            return self.copy()
        return self
    if self._needs_reindex_multi(axes, method, level):
        try:
            return self._reindex_multi(axes, copy, fill_value)
        except Exception:
            pass
    return self._reindex_axes(axes, level, limit, tolerance, method, fill_value, copy).__finalize__(self)
Conform %(klass)s to new index with optional filling logic, placing
NA/NaN in locations having no value in the previous index. A new object
is produced unless the new index is equivalent to the current one and
``copy=False``.

Parameters
----------
%(optional_labels)s
%(axes)s : array-like, optional
    New labels / index to conform to, should be specified using
    keywords. Preferably an Index object to avoid duplicating data
%(optional_axis)s
method : {None, 'backfill'/'bfill', 'pad'/'ffill', 'nearest'}
    Method to use for filling holes in reindexed DataFrame.
    Please note: this is only applicable to DataFrames/Series with a
    monotonically increasing/decreasing index.

    * None (default): don't fill gaps
    * pad / ffill: propagate last valid observation forward to next
      valid
    * backfill / bfill: use next valid observation to fill gap
    * nearest: use nearest valid observations to fill gap

copy : bool, default True
    Return a new object, even if the passed indexes are the same.
level : int or name
    Broadcast across a level, matching Index values on the
    passed MultiIndex level.
fill_value : scalar, default np.NaN
    Value to use for missing values. Defaults to NaN, but can be any
    "compatible" value.
limit : int, default None
    Maximum number of consecutive elements to forward or backward fill.
tolerance : optional
    Maximum distance between original and new labels for inexact
    matches. The values of the index at the matching locations most
    satisfy the equation ``abs(index[indexer] - target) <= tolerance``.

    Tolerance may be a scalar value, which applies the same tolerance
    to all values, or list-like, which applies variable tolerance per
    element. List-like includes list, tuple, array, Series, and must be
    the same size as the index and its dtype must exactly match the
    index's type.

    .. versionadded:: 0.21.0 (list-like tolerance)

Returns
-------
%(klass)s with changed index.

See Also
--------
DataFrame.set_index : Set row labels.
DataFrame.reset_index : Remove row labels or move them to new columns.
DataFrame.reindex_like : Change to same indices as other DataFrame.

Examples
--------

``DataFrame.reindex`` supports two calling conventions

* ``(index=index_labels, columns=column_labels, ...)``
* ``(labels, axis={'index', 'columns'}, ...)``

We *highly* recommend using keyword arguments to clarify your
intent.

Create a dataframe with some fictional data.

>>> index = ['Firefox', 'Chrome', 'Safari', 'IE10', 'Konqueror']
>>> df = pd.DataFrame({
...      'http_status': [200,200,404,404,301],
...      'response_time': [0.04, 0.02, 0.07, 0.08, 1.0]},
...       index=index)
>>> df
           http_status  response_time
Firefox            200           0.04
Chrome             200           0.02
Safari             404           0.07
IE10               404           0.08
Konqueror          301           1.00

Create a new index and reindex the dataframe. By default
values in the new index that do not have corresponding
records in the dataframe are assigned ``NaN``.

>>> new_index= ['Safari', 'Iceweasel', 'Comodo Dragon', 'IE10',
...             'Chrome']
>>> df.reindex(new_index)
               http_status  response_time
Safari               404.0           0.07
Iceweasel              NaN            NaN
Comodo Dragon          NaN            NaN
IE10                 404.0           0.08
Chrome               200.0           0.02

We can fill in the missing values by passing a value to
the keyword ``fill_value``. Because the index is not monotonically
increasing or decreasing, we cannot use arguments to the keyword
``method`` to fill the ``NaN`` values.

>>> df.reindex(new_index, fill_value=0)
               http_status  response_time
Safari                 404           0.07
Iceweasel                0           0.00
Comodo Dragon            0           0.00
IE10                   404           0.08
Chrome                 200           0.02

>>> df.reindex(new_index, fill_value='missing')
              http_status response_time
Safari                404          0.07
Iceweasel         missing       missing
Comodo Dragon     missing       missing
IE10                  404          0.08
Chrome                200          0.02

We can also reindex the columns.

>>> df.reindex(columns=['http_status', 'user_agent'])
           http_status  user_agent
Firefox            200         NaN
Chrome             200         NaN
Safari             404         NaN
IE10               404         NaN
Konqueror          301         NaN

Or we can use "axis-style" keyword arguments

>>> df.reindex(['http_status', 'user_agent'], axis="columns")
           http_status  user_agent
Firefox            200         NaN
Chrome             200         NaN
Safari             404         NaN
IE10               404         NaN
Konqueror          301         NaN

To further illustrate the filling functionality in
``reindex``, we will create a dataframe with a
monotonically increasing index (for example, a sequence
of dates).

>>> date_index = pd.date_range('1/1/2010', periods=6, freq='D')
>>> df2 = pd.DataFrame({"prices": [100, 101, np.nan, 100, 89, 88]},
...                    index=date_index)
>>> df2
            prices
2010-01-01   100.0
2010-01-02   101.0
2010-01-03     NaN
2010-01-04   100.0
2010-01-05    89.0
2010-01-06    88.0

Suppose we decide to expand the dataframe to cover a wider
date range.

>>> date_index2 = pd.date_range('12/29/2009', periods=10, freq='D')
>>> df2.reindex(date_index2)
            prices
2009-12-29     NaN
2009-12-30     NaN
2009-12-31     NaN
2010-01-01   100.0
2010-01-02   101.0
2010-01-03     NaN
2010-01-04   100.0
2010-01-05    89.0
2010-01-06    88.0
2010-01-07     NaN

The index entries that did not have a value in the original data frame
(for example, '2009-12-29') are by default filled with ``NaN``.
If desired, we can fill in the missing values using one of several
options.

For example, to back-propagate the last valid value to fill the ``NaN``
values, pass ``bfill`` as an argument to the ``method`` keyword.

>>> df2.reindex(date_index2, method='bfill')
            prices
2009-12-29   100.0
2009-12-30   100.0
2009-12-31   100.0
2010-01-01   100.0
2010-01-02   101.0
2010-01-03     NaN
2010-01-04   100.0
2010-01-05    89.0
2010-01-06    88.0
2010-01-07     NaN

Please note that the ``NaN`` value present in the original dataframe
(at index value 2010-01-03) will not be filled by any of the
value propagation schemes. This is because filling while reindexing
does not look at dataframe values, but only compares the original and
desired indexes. If you do want to fill in the ``NaN`` values present
in the original dataframe, use the ``fillna()`` method.

See the :ref:`user guide <basics.reindexing>` for more.
def reindex(self, *args, **kwargs):
    '\n        Conform %(klass)s to new index with optional filling logic, placing\n        NA/NaN in locations having no value in the previous index. A new object\n        is produced unless the new index is equivalent to the current one and\n        ``copy=False``.\n\n        Parameters\n        ----------\n        %(optional_labels)s\n        %(axes)s : array-like, optional\n            New labels / index to conform to, should be specified using\n            keywords. Preferably an Index object to avoid duplicating data\n        %(optional_axis)s\n        method : {None, \'backfill\'/\'bfill\', \'pad\'/\'ffill\', \'nearest\'}\n            Method to use for filling holes in reindexed DataFrame.\n            Please note: this is only applicable to DataFrames/Series with a\n            monotonically increasing/decreasing index.\n\n            * None (default): don\'t fill gaps\n            * pad / ffill: propagate last valid observation forward to next\n              valid\n            * backfill / bfill: use next valid observation to fill gap\n            * nearest: use nearest valid observations to fill gap\n\n        copy : bool, default True\n            Return a new object, even if the passed indexes are the same.\n        level : int or name\n            Broadcast across a level, matching Index values on the\n            passed MultiIndex level.\n        fill_value : scalar, default np.NaN\n            Value to use for missing values. Defaults to NaN, but can be any\n            "compatible" value.\n        limit : int, default None\n            Maximum number of consecutive elements to forward or backward fill.\n        tolerance : optional\n            Maximum distance between original and new labels for inexact\n            matches. The values of the index at the matching locations most\n            satisfy the equation ``abs(index[indexer] - target) <= tolerance``.\n\n            Tolerance may be a scalar value, which applies the same tolerance\n            to all values, or list-like, which applies variable tolerance per\n            element. List-like includes list, tuple, array, Series, and must be\n            the same size as the index and its dtype must exactly match the\n            index\'s type.\n\n            .. versionadded:: 0.21.0 (list-like tolerance)\n\n        Returns\n        -------\n        %(klass)s with changed index.\n\n        See Also\n        --------\n        DataFrame.set_index : Set row labels.\n        DataFrame.reset_index : Remove row labels or move them to new columns.\n        DataFrame.reindex_like : Change to same indices as other DataFrame.\n\n        Examples\n        --------\n\n        ``DataFrame.reindex`` supports two calling conventions\n\n        * ``(index=index_labels, columns=column_labels, ...)``\n        * ``(labels, axis={\'index\', \'columns\'}, ...)``\n\n        We *highly* recommend using keyword arguments to clarify your\n        intent.\n\n        Create a dataframe with some fictional data.\n\n        >>> index = [\'Firefox\', \'Chrome\', \'Safari\', \'IE10\', \'Konqueror\']\n        >>> df = pd.DataFrame({\n        ...      \'http_status\': [200,200,404,404,301],\n        ...      \'response_time\': [0.04, 0.02, 0.07, 0.08, 1.0]},\n        ...       index=index)\n        >>> df\n                   http_status  response_time\n        Firefox            200           0.04\n        Chrome             200           0.02\n        Safari             404           0.07\n        IE10               404           0.08\n        Konqueror          301           1.00\n\n        Create a new index and reindex the dataframe. By default\n        values in the new index that do not have corresponding\n        records in the dataframe are assigned ``NaN``.\n\n        >>> new_index= [\'Safari\', \'Iceweasel\', \'Comodo Dragon\', \'IE10\',\n        ...             \'Chrome\']\n        >>> df.reindex(new_index)\n                       http_status  response_time\n        Safari               404.0           0.07\n        Iceweasel              NaN            NaN\n        Comodo Dragon          NaN            NaN\n        IE10                 404.0           0.08\n        Chrome               200.0           0.02\n\n        We can fill in the missing values by passing a value to\n        the keyword ``fill_value``. Because the index is not monotonically\n        increasing or decreasing, we cannot use arguments to the keyword\n        ``method`` to fill the ``NaN`` values.\n\n        >>> df.reindex(new_index, fill_value=0)\n                       http_status  response_time\n        Safari                 404           0.07\n        Iceweasel                0           0.00\n        Comodo Dragon            0           0.00\n        IE10                   404           0.08\n        Chrome                 200           0.02\n\n        >>> df.reindex(new_index, fill_value=\'missing\')\n                      http_status response_time\n        Safari                404          0.07\n        Iceweasel         missing       missing\n        Comodo Dragon     missing       missing\n        IE10                  404          0.08\n        Chrome                200          0.02\n\n        We can also reindex the columns.\n\n        >>> df.reindex(columns=[\'http_status\', \'user_agent\'])\n                   http_status  user_agent\n        Firefox            200         NaN\n        Chrome             200         NaN\n        Safari             404         NaN\n        IE10               404         NaN\n        Konqueror          301         NaN\n\n        Or we can use "axis-style" keyword arguments\n\n        >>> df.reindex([\'http_status\', \'user_agent\'], axis="columns")\n                   http_status  user_agent\n        Firefox            200         NaN\n        Chrome             200         NaN\n        Safari             404         NaN\n        IE10               404         NaN\n        Konqueror          301         NaN\n\n        To further illustrate the filling functionality in\n        ``reindex``, we will create a dataframe with a\n        monotonically increasing index (for example, a sequence\n        of dates).\n\n        >>> date_index = pd.date_range(\'1/1/2010\', periods=6, freq=\'D\')\n        >>> df2 = pd.DataFrame({"prices": [100, 101, np.nan, 100, 89, 88]},\n        ...                    index=date_index)\n        >>> df2\n                    prices\n        2010-01-01   100.0\n        2010-01-02   101.0\n        2010-01-03     NaN\n        2010-01-04   100.0\n        2010-01-05    89.0\n        2010-01-06    88.0\n\n        Suppose we decide to expand the dataframe to cover a wider\n        date range.\n\n        >>> date_index2 = pd.date_range(\'12/29/2009\', periods=10, freq=\'D\')\n        >>> df2.reindex(date_index2)\n                    prices\n        2009-12-29     NaN\n        2009-12-30     NaN\n        2009-12-31     NaN\n        2010-01-01   100.0\n        2010-01-02   101.0\n        2010-01-03     NaN\n        2010-01-04   100.0\n        2010-01-05    89.0\n        2010-01-06    88.0\n        2010-01-07     NaN\n\n        The index entries that did not have a value in the original data frame\n        (for example, \'2009-12-29\') are by default filled with ``NaN``.\n        If desired, we can fill in the missing values using one of several\n        options.\n\n        For example, to back-propagate the last valid value to fill the ``NaN``\n        values, pass ``bfill`` as an argument to the ``method`` keyword.\n\n        >>> df2.reindex(date_index2, method=\'bfill\')\n                    prices\n        2009-12-29   100.0\n        2009-12-30   100.0\n        2009-12-31   100.0\n        2010-01-01   100.0\n        2010-01-02   101.0\n        2010-01-03     NaN\n        2010-01-04   100.0\n        2010-01-05    89.0\n        2010-01-06    88.0\n        2010-01-07     NaN\n\n        Please note that the ``NaN`` value present in the original dataframe\n        (at index value 2010-01-03) will not be filled by any of the\n        value propagation schemes. This is because filling while reindexing\n        does not look at dataframe values, but only compares the original and\n        desired indexes. If you do want to fill in the ``NaN`` values present\n        in the original dataframe, use the ``fillna()`` method.\n\n        See the :ref:`user guide <basics.reindexing>` for more.\n        '
    (axes, kwargs) = self._construct_axes_from_arguments(args, kwargs)
    method = missing.clean_reindex_fill_method(kwargs.pop('method', None))
    level = kwargs.pop('level', None)
    copy = kwargs.pop('copy', True)
    limit = kwargs.pop('limit', None)
    tolerance = kwargs.pop('tolerance', None)
    fill_value = kwargs.pop('fill_value', None)
    kwargs.pop('axis', None)
    if kwargs:
        raise TypeError('reindex() got an unexpected keyword argument "{0}"'.format(list(kwargs.keys())[0]))
    self._consolidate_inplace()
    if all((self._get_axis(axis).identical(ax) for (axis, ax) in axes.items() if (ax is not None))):
        if copy:
            return self.copy()
        return self
    if self._needs_reindex_multi(axes, method, level):
        try:
            return self._reindex_multi(axes, copy, fill_value)
        except Exception:
            pass
    return self._reindex_axes(axes, level, limit, tolerance, method, fill_value, copy).__finalize__(self)