<commit_before>.. _whatsnew_0130:

v0.13.0 (August ??, 2013)
-------------------------

This is a major release from 0.12.0 and includes several new features and
enhancements along with a large number of bug fixes.

.. warning::

   In 0.13.0 ``Series`` has internaly been refactored to no longer sub-class ``ndarray``
   but instead subclass ``NDFrame``, similarly to the rest of the pandas containers. This should be
   a transparent change with only very limited API implications. See :ref:`Internal Refactoring<whatsnew_0130.refactoring>`

API changes
~~~~~~~~~~~

  - ``read_excel`` now supports an integer in its ``sheetname`` argument giving
    the index of the sheet to read in (:issue:`4301`).
  - Text parser now treats anything that reads like inf ("inf", "Inf", "-Inf",
    "iNf", etc.) as infinity. (:issue:`4220`, :issue:`4219`), affecting
    ``read_table``, ``read_csv``, etc.
  - ``pandas`` now is Python 2/3 compatible without the need for 2to3 thanks to
    @jtratner. As a result, pandas now uses iterators more extensively. This
    also led to the introduction of substantive parts of the Benjamin
    Peterson's ``six`` library into compat. (:issue:`4384`, :issue:`4375`,
    :issue:`4372`)
  - ``pandas.util.compat`` and ``pandas.util.py3compat`` have been merged into
    ``pandas.compat``. ``pandas.compat`` now includes many functions allowing
    2/3 compatibility. It contains both list and iterator versions of range,
    filter, map and zip, plus other necessary elements for Python 3
    compatibility. ``lmap``, ``lzip``, ``lrange`` and ``lfilter`` all produce
    lists instead of iterators, for compatibility with ``numpy``, subscripting
    and ``pandas`` constructors.(:issue:`4384`, :issue:`4375`, :issue:`4372`)
  - deprecated ``iterkv``, which will be removed in a future release (was just
    an alias of iteritems used to get around ``2to3``'s changes).
    (:issue:`4384`, :issue:`4375`, :issue:`4372`)
  - ``Series.get`` with negative indexers now returns the same as ``[]`` (:issue:`4390`)
  - ``HDFStore``

    - Significant table writing performance improvements
    - handle a passed ``Series`` in table format (:issue:`4330`)
    - added an ``is_open`` property to indicate if the underlying file handle is_open;
      a closed store will now report 'CLOSED' when viewing the store (rather than raising an error)
      (:issue:`4409`)
    - a close of a ``HDFStore`` now will close that instance of the ``HDFStore``
      but will only close the actual file if the ref count (by ``PyTables``) w.r.t. all of the open handles
      are 0. Essentially you have a local instance of ``HDFStore`` referenced by a variable. Once you
      close it, it will report closed. Other references (to the same file) will continue to operate
      until they themselves are closed. Performing an action on a closed file will raise
      ``ClosedFileError``

      .. ipython:: python

         path = 'test.h5'
         df = DataFrame(randn(10,2))
         store1 = HDFStore(path)
         store2 = HDFStore(path)
         store1.append('df',df)
         store2.append('df2',df)

         store1
         store2
         store1.close()
         store2
         store2.close()
         store2

      .. ipython:: python
         :suppress:

         import os
         os.remove(path)

    - removed the ``_quiet`` attribute, replace by a ``DuplicateWarning`` if retrieving
      duplicate rows from a table (:issue:`4367`)
    - removed the ``warn`` argument from ``open``. Instead a ``PossibleDataLossError`` exception will
      be raised if you try to use ``mode='w'`` with an OPEN file handle (:issue:`4367`)
    - allow a passed locations array or mask as a ``where`` condition (:issue:`4467`).
      See :ref:`here<io.hdf5-where_mask>` for an example.

    - the ``fmt`` keyword now replaces the ``table`` keyword; allowed values are ``s|t``
      the same defaults as prior < 0.13.0 remain, e.g. ``put`` implies 's' (Storer) format
      and ``append`` imples 't' (Table) format

      .. ipython:: python

         path = 'test.h5'
         df = DataFrame(randn(10,2))
         df.to_hdf(path,'df_table',fmt='t')
         df.to_hdf(path,'df_table2',append=True)
         df.to_hdf(path,'df_storer')
         with get_store(path) as store:
            print store

      .. ipython:: python
         :suppress:

         import os
         os.remove(path)

  - Changes to how ``Index`` and ``MultiIndex`` handle metadata (``levels``,
    ``labels``, and ``names``) (:issue:`4039`):

    ..code-block ::

        # previously, you would have set levels or labels directly
        index.levels = [[1, 2, 3, 4], [1, 2, 4, 4]]

        # now, you use the set_levels or set_labels methods
        index = index.set_levels([[1, 2, 3, 4], [1, 2, 4, 4]])

        # similarly, for names, you can rename the object
        # but setting names is not deprecated.
        index = index.set_names(["bob", "cranberry"])

        # and all methods take an inplace kwarg
        index.set_names(["bob", "cranberry"], inplace=True)

  - Infer and downcast dtype if ``downcast='infer'`` is passed to ``fillna/ffill/bfill`` (:issue:`4604`)

Enhancements
~~~~~~~~~~~~

  - ``read_html`` now raises a ``URLError`` instead of catching and raising a
    ``ValueError`` (:issue:`4303`, :issue:`4305`)
  - Added a test for ``read_clipboard()`` and ``to_clipboard()`` (:issue:`4282`)
  - Clipboard functionality now works with PySide (:issue:`4282`)
  - Added a more informative error message when plot arguments contain
    overlapping color and style arguments (:issue:`4402`)

  - ``timedelta64[ns]`` operations

    - A Series of dtype ``timedelta64[ns]`` can now be divided by another
      ``timedelta64[ns]`` object to yield a ``float64`` dtyped Series. This
      is frequency conversion. See :ref:`here<timeseries.timedeltas_convert>` for the docs.

      .. ipython:: python

         from datetime import timedelta
         td = Series(date_range('20130101',periods=4))-Series(date_range('20121201',periods=4))
         td[2] += np.timedelta64(timedelta(minutes=5,seconds=3))
         td[3] = np.nan
         td

         # to days
         td / np.timedelta64(1,'D')

         # to seconds
         td / np.timedelta64(1,'s')
<commit_msg>DOC add get_dummies NaN to whatsnew<commit_after>.. _whatsnew_0130:

v0.13.0 (August ??, 2013)
-------------------------

This is a major release from 0.12.0 and includes several new features and
enhancements along with a large number of bug fixes.

.. warning::

   In 0.13.0 ``Series`` has internaly been refactored to no longer sub-class ``ndarray``
   but instead subclass ``NDFrame``, similarly to the rest of the pandas containers. This should be
   a transparent change with only very limited API implications. See :ref:`Internal Refactoring<whatsnew_0130.refactoring>`

API changes
~~~~~~~~~~~

  - ``read_excel`` now supports an integer in its ``sheetname`` argument giving
    the index of the sheet to read in (:issue:`4301`).
  - Text parser now treats anything that reads like inf ("inf", "Inf", "-Inf",
    "iNf", etc.) as infinity. (:issue:`4220`, :issue:`4219`), affecting
    ``read_table``, ``read_csv``, etc.
  - ``pandas`` now is Python 2/3 compatible without the need for 2to3 thanks to
    @jtratner. As a result, pandas now uses iterators more extensively. This
    also led to the introduction of substantive parts of the Benjamin
    Peterson's ``six`` library into compat. (:issue:`4384`, :issue:`4375`,
    :issue:`4372`)
  - ``pandas.util.compat`` and ``pandas.util.py3compat`` have been merged into
    ``pandas.compat``. ``pandas.compat`` now includes many functions allowing
    2/3 compatibility. It contains both list and iterator versions of range,
    filter, map and zip, plus other necessary elements for Python 3
    compatibility. ``lmap``, ``lzip``, ``lrange`` and ``lfilter`` all produce
    lists instead of iterators, for compatibility with ``numpy``, subscripting
    and ``pandas`` constructors.(:issue:`4384`, :issue:`4375`, :issue:`4372`)
  - deprecated ``iterkv``, which will be removed in a future release (was just
    an alias of iteritems used to get around ``2to3``'s changes).
    (:issue:`4384`, :issue:`4375`, :issue:`4372`)
  - ``Series.get`` with negative indexers now returns the same as ``[]`` (:issue:`4390`)
  - ``HDFStore``

    - Significant table writing performance improvements
    - handle a passed ``Series`` in table format (:issue:`4330`)
    - added an ``is_open`` property to indicate if the underlying file handle is_open;
      a closed store will now report 'CLOSED' when viewing the store (rather than raising an error)
      (:issue:`4409`)
    - a close of a ``HDFStore`` now will close that instance of the ``HDFStore``
      but will only close the actual file if the ref count (by ``PyTables``) w.r.t. all of the open handles
      are 0. Essentially you have a local instance of ``HDFStore`` referenced by a variable. Once you
      close it, it will report closed. Other references (to the same file) will continue to operate
      until they themselves are closed. Performing an action on a closed file will raise
      ``ClosedFileError``

      .. ipython:: python

         path = 'test.h5'
         df = DataFrame(randn(10,2))
         store1 = HDFStore(path)
         store2 = HDFStore(path)
         store1.append('df',df)
         store2.append('df2',df)

         store1
         store2
         store1.close()
         store2
         store2.close()
         store2

      .. ipython:: python
         :suppress:

         import os
         os.remove(path)

    - removed the ``_quiet`` attribute, replace by a ``DuplicateWarning`` if retrieving
      duplicate rows from a table (:issue:`4367`)
    - removed the ``warn`` argument from ``open``. Instead a ``PossibleDataLossError`` exception will
      be raised if you try to use ``mode='w'`` with an OPEN file handle (:issue:`4367`)
    - allow a passed locations array or mask as a ``where`` condition (:issue:`4467`).
      See :ref:`here<io.hdf5-where_mask>` for an example.

    - the ``fmt`` keyword now replaces the ``table`` keyword; allowed values are ``s|t``
      the same defaults as prior < 0.13.0 remain, e.g. ``put`` implies 's' (Storer) format
      and ``append`` imples 't' (Table) format

      .. ipython:: python

         path = 'test.h5'
         df = DataFrame(randn(10,2))
         df.to_hdf(path,'df_table',fmt='t')
         df.to_hdf(path,'df_table2',append=True)
         df.to_hdf(path,'df_storer')
         with get_store(path) as store:
            print store

      .. ipython:: python
         :suppress:

         import os
         os.remove(path)

  - Changes to how ``Index`` and ``MultiIndex`` handle metadata (``levels``,
    ``labels``, and ``names``) (:issue:`4039`):

    ..code-block ::

        # previously, you would have set levels or labels directly
        index.levels = [[1, 2, 3, 4], [1, 2, 4, 4]]

        # now, you use the set_levels or set_labels methods
        index = index.set_levels([[1, 2, 3, 4], [1, 2, 4, 4]])

        # similarly, for names, you can rename the object
        # but setting names is not deprecated.
        index = index.set_names(["bob", "cranberry"])

        # and all methods take an inplace kwarg
        index.set_names(["bob", "cranberry"], inplace=True)

  - Infer and downcast dtype if ``downcast='infer'`` is passed to ``fillna/ffill/bfill`` (:issue:`4604`)

Enhancements
~~~~~~~~~~~~

  - ``read_html`` now raises a ``URLError`` instead of catching and raising a
    ``ValueError`` (:issue:`4303`, :issue:`4305`)
  - Added a test for ``read_clipboard()`` and ``to_clipboard()`` (:issue:`4282`)
  - Clipboard functionality now works with PySide (:issue:`4282`)
  - Added a more informative error message when plot arguments contain
    overlapping color and style arguments (:issue:`4402`)

  - NaN handing in get_dummies (:issue:`4446`) with `dummy_na`

    .. ipython:: python
       # previously, nan was erroneously counted as 2 here
       # now it is not counted at all
       get_dummies([1, 2, np.nan])

       # unless requested
       get_dummies([1, 2, np.nan], dummy_na=True)


  - ``timedelta64[ns]`` operations

    - A Series of dtype ``timedelta64[ns]`` can now be divided by another
      ``timedelta64[ns]`` object to yield a ``float64`` dtyped Series. This
      is frequency conversion. See :ref:`here<timeseries.timedeltas_convert>` for the docs.

      .. ipython:: python

         from datetime import timedelta
         td = Series(date_range('20130101',periods=4))-Series(date_range('20121201',periods=4))
         td[2] += np.timedelta64(timedelta(minutes=5,seconds=3))
         td[3] = np.nan
         td

         # to days
         td / np.timedelta64(1,'D')

         # to seconds
         td / np.timedelta64(1,'s')

{'fraction_non_alphanumeric': 0.1326538551310978, 'fraction_numerical': 0.03399984439430483, 'mean_word_length': 2.9919254658385093, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6138244', 'n_tokens_mistral': 4178, 'n_tokens_neox': 3798, 'n_words': 1410}