Skip to content

Commit 01dcacd

Browse files
author
dacoex
committed
added more namespace
Generally, also numpy's randn should used as np.random.randn
1 parent 84fc7bf commit 01dcacd

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

doc/source/io.rst

+22-6
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ Writing to a file, with a date index and a date column
13991399
dfj2['date'] = Timestamp('20130101')
14001400
dfj2['ints'] = list(range(5))
14011401
dfj2['bools'] = True
1402-
dfj2.index = date_range('20130101', periods=5)
1402+
dfj2.index = pd.date_range('20130101', periods=5)
14031403
dfj2.to_json('test.json')
14041404
open('test.json').read()
14051405
@@ -2562,7 +2562,7 @@ dict:
25622562
.. ipython:: python
25632563
25642564
np.random.seed(1234)
2565-
index = date_range('1/1/2000', periods=8)
2565+
index = pd.date_range('1/1/2000', periods=8)
25662566
s = Series(randn(5), index=['a', 'b', 'c', 'd', 'e'])
25672567
df = DataFrame(randn(8, 3), index=index,
25682568
columns=['A', 'B', 'C'])
@@ -2754,7 +2754,7 @@ enable ``put/append/to_hdf`` to by default store in the ``table`` format.
27542754
27552755
.. ipython:: python
27562756
2757-
store = HDFStore('store.h5')
2757+
store = pd.HDFStore('store.h5')
27582758
df1 = df[0:4]
27592759
df2 = df[4:]
27602760
@@ -2801,6 +2801,22 @@ everything in the sub-store and BELOW, so be *careful*.
28012801
28022802
.. _io.hdf5-types:
28032803

2804+
.. warning:: Hierarchical keys cannot be retrieved as dotted (attribute) access as described above for items stored under root node.
2805+
2806+
.. ipython:: python
2807+
2808+
store.foo.bar.bah
2809+
AttributeError: 'HDFStore' object has no attribute 'foo'
2810+
2811+
store.root.foo.bar.bah
2812+
/foo/bar/bah (Group) ''
2813+
children := ['block0_items' (Array), 'axis1' (Array), 'axis0' (Array), 'block0_values' (Array)]
2814+
2815+
2816+
2817+
2818+
2819+
28042820
Storing Types
28052821
'''''''''''''
28062822

@@ -3364,7 +3380,7 @@ Compression for all objects within the file
33643380

33653381
.. code-block:: python
33663382
3367-
store_compressed = HDFStore('store_compressed.h5', complevel=9, complib='blosc')
3383+
store_compressed = pd.HDFStore('store_compressed.h5', complevel=9, complib='blosc')
33683384
33693385
Or on-the-fly compression (this only applies to tables). You can turn
33703386
off file compression for a specific table by passing ``complevel=0``
@@ -3573,7 +3589,7 @@ It is possible to write an ``HDFStore`` object that can easily be imported into
35733589
index=range(100))
35743590
df_for_r.head()
35753591
3576-
store_export = HDFStore('export.h5')
3592+
store_export = pd.HDFStore('export.h5')
35773593
store_export.append('df_for_r', df_for_r, data_columns=df_dc.columns)
35783594
store_export
35793595
@@ -3662,7 +3678,7 @@ number of options, please see the docstring.
36623678
.. ipython:: python
36633679
36643680
# a legacy store
3665-
legacy_store = HDFStore(legacy_file_path,'r')
3681+
legacy_store = pd.HDFStore(legacy_file_path,'r')
36663682
legacy_store
36673683
36683684
# copy (and return the new handle)

0 commit comments

Comments
 (0)