Skip to content

Commit a4a21ae

Browse files
committed
revert io changes
1 parent 04bf466 commit a4a21ae

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

doc/source/user_guide/io.rst

+18-23
Original file line numberDiff line numberDiff line change
@@ -4641,6 +4641,14 @@ Several caveats.
46414641

46424642
See the `Full Documentation <https://github.com/wesm/feather>`__.
46434643

4644+
.. ipython:: python
4645+
:suppress:
4646+
4647+
import warnings
4648+
# This can be removed once building with pyarrow >=0.15.0
4649+
warnings.filterwarnings("ignore", "The Sparse", FutureWarning)
4650+
4651+
46444652
.. ipython:: python
46454653
46464654
df = pd.DataFrame({'a': list('abc'),
@@ -4659,38 +4667,25 @@ See the `Full Documentation <https://github.com/wesm/feather>`__.
46594667
Write to a feather file.
46604668

46614669
.. ipython:: python
4670+
:okwarning:
46624671
4663-
>>> df.to_feather('example.feather')
4672+
df.to_feather('example.feather')
46644673
46654674
Read from a feather file.
46664675

4667-
.. code-block:: python
4676+
.. ipython:: python
4677+
:okwarning:
46684678
4669-
>>> result = pd.read_feather('example.feather')
4670-
>>> result
4671-
a b c d e f g h i
4672-
0 a 1 3 4.0 True a 2013-01-01 2013-01-01 00:00:00-05:00 2013-01-01 00:00:00.000000000
4673-
1 b 2 4 5.0 False b 2013-01-02 2013-01-02 00:00:00-05:00 2013-01-01 00:00:00.000000001
4674-
2 c 3 5 6.0 True c 2013-01-03 2013-01-03 00:00:00-05:00 2013-01-01 00:00:00.000000002
4675-
4676-
>>> # we preserve dtypes
4677-
>>> result.dtypes
4678-
a object
4679-
b int64
4680-
c uint8
4681-
d float64
4682-
e bool
4683-
f category
4684-
g datetime64[ns]
4685-
h datetime64[ns, US/Eastern]
4686-
i datetime64[ns]
4687-
dtype: object
4679+
result = pd.read_feather('example.feather')
4680+
result
4681+
4682+
# we preserve dtypes
4683+
result.dtypes
46884684
46894685
.. ipython:: python
46904686
:suppress:
46914687
4692-
if os.path.exists("example.feather"):
4693-
os.remove('example.feather')
4688+
os.remove('example.feather')
46944689
46954690
46964691
.. _io.parquet:

0 commit comments

Comments
 (0)