8000 Relocate exceptions #14800 by m-charlton · Pull Request #15181 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Relocate exceptions #14800 #15181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates after review
DataFrame.astype now allows changing the dtype of a column by
passing a dict mapping column name to dtype.
  • Loading branch information
m-charlton committed Dec 15, 2016
commit fddbb2ed0537cd32c3e37f61983972e1957399d4
8000
12 changes: 12 additions & 0 deletions doc/source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,18 @@ Convert a subset of columns to a specified type using :meth:`~DataFrame.astype`
dft.loc[:, ['a', 'b']] = dft.loc[:, ['a', 'b']].astype(np.uint8)
dft.dtypes


.. versionadded:: 0.19

Convert certain columns to a specific dtype by passing a dict to :meth:`~DataFrame.astype`

.. ipython:: python

dft1 = pd.DataFrame({'a': [1,0,1], 'b': [4,5,6], 'c': [7, 8, 9]})
dft1 = dft1.astype({'a': np.bool, 'c': np.float64})
dft1
dft1.dtypes

.. _basics.object_conversion:

object conversion
Expand Down
0