File tree 1 file changed +18
-23
lines changed
1 file changed +18
-23
lines changed Original file line number Diff line number Diff line change @@ -4641,6 +4641,14 @@ Several caveats.
4641
4641
4642
4642
See the `Full Documentation <https://github.com/wesm/feather >`__.
4643
4643
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
+
4644
4652
.. ipython :: python
4645
4653
4646
4654
df = pd.DataFrame({' a' : list (' abc' ),
@@ -4659,38 +4667,25 @@ See the `Full Documentation <https://github.com/wesm/feather>`__.
4659
4667
Write to a feather file.
4660
4668
4661
4669
.. ipython :: python
4670
+ :okwarning:
4662
4671
4663
- >> > df.to_feather(' example.feather' )
4672
+ df.to_feather(' example.feather' )
4664
4673
4665
4674
Read from a feather file.
4666
4675
4667
- .. code-block :: python
4676
+ .. ipython :: python
4677
+ :okwarning:
4668
4678
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
4688
4684
4689
4685
.. ipython :: python
4690
4686
:suppress:
4691
4687
4692
- if os.path.exists(" example.feather" ):
4693
- os.remove(' example.feather' )
4688
+ os.remove(' example.feather' )
4694
4689
4695
4690
4696
4691
.. _io.parquet :
You can’t perform that action at this time.
0 commit comments