Skip to content

Commit 3a45ddf

Browse files
committed
Split up the IO docs
1 parent 8fe2720 commit 3a45ddf

22 files changed

+6593
-6490
lines changed

doc/redirects.csv

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ gotchas,user_guide/gotchas
2424
groupby,user_guide/groupby
2525
indexing,user_guide/indexing
2626
integer_na,user_guide/integer_na
27-
io,user_guide/io
27+
io,user_guide/io/index
28+
user_guide/io,user_guide/io/index
2829
merging,user_guide/merging
2930
missing_data,user_guide/missing_data
3031
options,user_guide/options

doc/source/user_guide/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Guides
6363
10min
6464
dsintro
6565
basics
66-
io
66+
io/index
6767
pyarrow
6868
indexing
6969
advanced

doc/source/user_guide/io.rst

-6,487
This file was deleted.
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.. _io.clipboard:
2+
3+
=========
4+
Clipboard
5+
=========
6+
7+
A handy way to grab data is to use the :meth:`~DataFrame.read_clipboard` method,
8+
which takes the contents of the clipboard buffer and passes them to the
9+
``read_csv`` method. For instance, you can copy the following text to the
10+
clipboard (CTRL-C on many operating systems):
11+
12+
.. code-block:: console
13+
14+
A B C
15+
x 1 4 p
16+
y 2 5 q
17+
z 3 6 r
18+
19+
And then import the data directly to a ``DataFrame`` by calling:
20+
21+
.. code-block:: python
22+
23+
>>> clipdf = pd.read_clipboard()
24+
>>> clipdf
25+
A B C
26+
x 1 4 p
27+
y 2 5 q
28+
z 3 6 r
29+
30+
The ``to_clipboard`` method can be used to write the contents of a ``DataFrame`` to
31+
the clipboard. Following which you can paste the clipboard contents into other
32+
applications (CTRL-V on many operating systems). Here we illustrate writing a
33+
``DataFrame`` into clipboard and reading it back.
34+
35+
.. code-block:: python
36+
37+
>>> df = pd.DataFrame(
38+
... {"A": [1, 2, 3], "B": [4, 5, 6], "C": ["p", "q", "r"]}, index=["x", "y", "z"]
39+
... )
40+
41+
>>> df
42+
A B C
43+
x 1 4 p
44+
y 2 5 q
45+
z 3 6 r
46+
>>> df.to_clipboard()
47+
>>> pd.read_clipboard()
48+
A B C
49+
x 1 4 p
50+
y 2 5 q
51+
z 3 6 r
52+
53+
We can see that we got the same content back, which we had earlier written to the clipboard.
54+
55+
.. note::
56+
57+
You may need to install xclip or xsel (with PyQt5, PyQt4 or qtpy) on Linux to use these methods.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. _io.other:
2+
3+
================================
4+
Community-supported file formats
5+
================================
6+
7+
pandas itself only supports IO with a limited set of file formats that map
8+
cleanly to its tabular data model. For reading and writing other file formats
9+
into and from pandas, we recommend these packages from the broader community.
10+
11+
.. _io.bigquery:
12+
13+
Google BigQuery
14+
'''''''''''''''
15+
16+
The pandas-gbq_ package provides functionality to read/write from Google BigQuery.
17+
18+
.. _pandas-gbq: https://pandas-gbq.readthedocs.io/en/latest/
19+
20+
netCDF
21+
''''''
22+
23+
xarray_ provides data structures inspired by the pandas ``DataFrame`` for working
24+
with multi-dimensional datasets, with a focus on the netCDF file format and
25+
easy conversion to and from pandas.
26+
27+
.. _xarray: https://xarray.pydata.org/en/stable/

0 commit comments

Comments
 (0)