Skip to content

DOC: Split up the IO docs #60825

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
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion doc/redirects.csv
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ gotchas,user_guide/gotchas
groupby,user_guide/groupby
indexing,user_guide/indexing
integer_na,user_guide/integer_na
io,user_guide/io
io,user_guide/io/index
user_guide/io,user_guide/io/index
merging,user_guide/merging
missing_data,user_guide/missing_data
options,user_guide/options
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Guides
10min
dsintro
basics
io
io/index
pyarrow
indexing
advanced
Expand Down
6,487 changes: 0 additions & 6,487 deletions doc/source/user_guide/io.rst

This file was deleted.

57 changes: 57 additions & 0 deletions doc/source/user_guide/io/clipboard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. _io.clipboard:

=========
Clipboard
=========

A handy way to grab data is to use the :meth:`~DataFrame.read_clipboard` method,
which takes the contents of the clipboard buffer and passes them to the
``read_csv`` method. For instance, you can copy the following text to the
clipboard (CTRL-C on many operating systems):

.. code-block:: console

A B C
x 1 4 p
y 2 5 q
z 3 6 r

And then import the data directly to a ``DataFrame`` by calling:

.. code-block:: python

>>> clipdf = pd.read_clipboard()
>>> clipdf
A B C
x 1 4 p
y 2 5 q
z 3 6 r

The ``to_clipboard`` method can be used to write the contents of a ``DataFrame`` to
the clipboard. Following which you can paste the clipboard contents into other
applications (CTRL-V on many operating systems). Here we illustrate writing a
``DataFrame`` into clipboard and reading it back.

.. code-block:: python

>>> df = pd.DataFrame(
... {"A": [1, 2, 3], "B": [4, 5, 6], "C": ["p", "q", "r"]}, index=["x", "y", "z"]
... )

>>> df
A B C
x 1 4 p
y 2 5 q
z 3 6 r
>>> df.to_clipboard()
>>> pd.read_clipboard()
A B C
x 1 4 p
y 2 5 q
z 3 6 r

We can see that we got the same content back, which we had earlier written to the clipboard.

.. note::

You may need to install xclip or xsel (with PyQt5, PyQt4 or qtpy) on Linux to use these methods.
27 changes: 27 additions & 0 deletions doc/source/user_guide/io/community_packages.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _io.other:

================================
Community-supported file formats
================================

pandas itself only supports IO with a limited set of file formats that map
cleanly to its tabular data model. For reading and writing other file formats
into and from pandas, we recommend these packages from the broader community.

.. _io.bigquery:

Google BigQuery
'''''''''''''''

The pandas-gbq_ package provides functionality to read/write from Google BigQuery.

.. _pandas-gbq: https://pandas-gbq.readthedocs.io/en/latest/

netCDF
''''''

xarray_ provides data structures inspired by the pandas ``DataFrame`` for working
with multi-dimensional datasets, with a focus on the netCDF file format and
easy conversion to and from pandas.

.. _xarray: https://xarray.pydata.org/en/stable/
Loading
Loading