19
19
Cookbook
20
20
********
21
21
22
- This is a respository for *short and sweet * example and links for useful pandas recipes.
23
- We encourage users to add to this documentation. This is a great *First Pull Request *.
22
+ This is a respository for *short and sweet * examples and links for useful pandas recipes.
23
+ We encourage users to add to this documentation.
24
+
25
+ This is a great *First Pull Request * (to add interesting links and/or put short code inline
26
+ for existing links)
24
27
25
28
Selection
26
29
---------
@@ -102,6 +105,9 @@ Timeseries
102
105
`Between times
103
106
<http://stackoverflow.com/questions/14539992/pandas-drop-rows-outside-of-time-range> `__
104
107
108
+ `Vectorized Lookup
109
+ <http://stackoverflow.com/questions/13893227/vectorized-look-up-of-values-in-pandas-dataframe> `__
110
+
105
111
Resampling
106
112
~~~~~~~~~~
107
113
@@ -138,6 +144,9 @@ Plotting
138
144
`Make Matplotlib look like R
139
145
<http://stackoverflow.com/questions/14349055/making-matplotlib-graphs-look-like-r-by-default> `__
140
146
147
+ `Setting x-axis major and minor labels
148
+ <http://stackoverflow.com/questions/12945971/pandas-timeseries-plot-setting-x-axis-major-and-minor-ticks-and-labels> `__
149
+
141
150
Data In/Out
142
151
-----------
143
152
150
159
`Reading the first few lines of a frame
151
160
<http://stackoverflow.com/questions/15008970/way-to-read-first-few-lines-for-pandas-dataframe> `__
152
161
162
+ SQL
163
+ ~~~
164
+
165
+ `Reading from databases with SQL
166
+ <http://stackoverflow.com/questions/10065051/python-pandas-and-databases-like-mysql> `__
167
+
153
168
HDF5
154
169
~~~~
155
170
@@ -165,6 +180,24 @@ HDF5
165
180
`Large Data work flows
166
181
<http://stackoverflow.com/questions/14262433/large-data-work-flows-using-pandas> `__
167
182
183
+ Storing Attributes to a group node
184
+
185
+ .. ipython :: python
186
+
187
+ df = DataFrame(np.random.randn(8 ,3 ))
188
+ store = HDFStore(' test.h5' )
189
+ store.put(' df' ,df)
190
+
191
+ # you can store an arbitrary python object via pickle
192
+ store.get_storer(' df' ).attrs.my_attribute = dict (A = 10 )
193
+ store.get_storer(' df' ).attrs.my_attribute
194
+
195
+ .. ipython :: python
196
+ :suppress:
197
+
198
+ store.close()
199
+ os.remove(' test.h5' )
200
+
168
201
Miscellaneous
169
202
-------------
170
203
0 commit comments