Skip to content

Commit 66fc298

Browse files
authored
Merge pull request statsmodels#4853 from bashtage/remove-recarray-data
REF: Remove recarrays from datasets and related code
2 parents d48b257 + 0d89151 commit 66fc298

File tree

125 files changed

+1082
-1407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1082
-1407
lines changed

docs/source/anova.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Examples
1717
import statsmodels.api as sm
1818
from statsmodels.formula.api import ols
1919
20-
moore = sm.datasets.get_rdataset("Moore", "car",
20+
moore = sm.datasets.get_rdataset("Moore", "carData",
2121
cache=True) # load data
2222
data = moore.data
2323
data = data.rename(columns={"partner.status":

docs/source/contingency_tables.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ methods and attributes.
267267
data = sm.datasets.china_smoking.load()
268268
269269
mat = np.asarray(data.data)
270-
tables = [np.reshape(x.tolist()[1:], (2, 2)) for x in mat]
270+
tables = [np.reshape(x.tolist(), (2, 2)) for x in mat]
271271
272272
st = sm.stats.StratifiedTable(tables)
273273
print(st.summary())

docs/source/datasets/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The `Rdatasets project <http://vincentarelbundock.github.io/Rdatasets/>`__ gives
3030
.. ipython:: python
3131
3232
import statsmodels.api as sm
33-
duncan_prestige = sm.datasets.get_rdataset("Duncan", "car")
33+
duncan_prestige = sm.datasets.get_rdataset("Duncan", "carData")
3434
print(duncan_prestige.__doc__)
3535
duncan_prestige.data.head(5)
3636

examples/notebooks/markov_autoregression.ipynb

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
{
2020
"cell_type": "code",
2121
"execution_count": null,
22-
"metadata": {
23-
"collapsed": false
24-
},
22+
"metadata": {},
2523
"outputs": [],
2624
"source": [
2725
"%matplotlib inline\n",
@@ -70,9 +68,7 @@
7068
{
7169
"cell_type": "code",
7270
"execution_count": null,
73-
"metadata": {
74-
"collapsed": false
75-
},
71+
"metadata": {},
7672
"outputs": [],
7773
"source": [
7874
"# Get the RGNP data to replicate Hamilton\n",
@@ -91,9 +87,7 @@
9187
{
9288
"cell_type": "code",
9389
"execution_count": null,
94-
"metadata": {
95-
"collapsed": false
96-
},
90+
"metadata": {},
9791
"outputs": [],
9892
"source": [
9993
"res_hamilton.summary()"
@@ -111,9 +105,7 @@
111105
{
112106
"cell_type": "code",
113107
"execution_count": null,
114-
"metadata": {
115-
"collapsed": false
116-
},
108+
"metadata": {},
117109
"outputs": [],
118110
"source": [
119111
"fig, axes = plt.subplots(2, figsize=(7,7))\n",
@@ -142,9 +134,7 @@
142134
{
143135
"cell_type": "code",
144136
"execution_count": null,
145-
"metadata": {
146-
"collapsed": false
147-
},
137+
"metadata": {},
148138
"outputs": [],
149139
"source": [
150140
"print(res_hamilton.expected_durations)"
@@ -180,9 +170,7 @@
180170
{
181171
"cell_type": "code",
182172
"execution_count": null,
183-
"metadata": {
184-
"collapsed": false
185-
},
173+
"metadata": {},
186174
"outputs": [],
187175
"source": [
188176
"# Get the dataset\n",
@@ -203,9 +191,7 @@
203191
{
204192
"cell_type": "code",
205193
"execution_count": null,
206-
"metadata": {
207-
"collapsed": false
208-
},
194+
"metadata": {},
209195
"outputs": [],
210196
"source": [
211197
"res_kns.summary()"
@@ -221,9 +207,7 @@
221207
{
222208
"cell_type": "code",
223209
"execution_count": null,
224-
"metadata": {
225-
"collapsed": false
226-
},
210+
"metadata": {},
227211
"outputs": [],
228212
"source": [
229213
"fig, axes = plt.subplots(3, figsize=(10,7))\n",
@@ -274,9 +258,7 @@
274258
{
275259
"cell_type": "code",
276260
"execution_count": null,
277-
"metadata": {
278-
"collapsed": false
279-
},
261+
"metadata": {},
280262
"outputs": [],
281263
"source": [
282264
"# Get the dataset\n",
@@ -314,9 +296,7 @@
314296
{
315297
"cell_type": "code",
316298
"execution_count": null,
317-
"metadata": {
318-
"collapsed": false
319-
},
299+
"metadata": {},
320300
"outputs": [],
321301
"source": [
322302
"mod_filardo = sm.tsa.MarkovAutoregression(\n",
@@ -330,9 +310,7 @@
330310
{
331311
"cell_type": "code",
332312
"execution_count": null,
333-
"metadata": {
334-
"collapsed": false
335-
},
313+
"metadata": {},
336314
"outputs": [],
337315
"source": [
338316
"res_filardo.summary()"
@@ -348,9 +326,7 @@
348326
{
349327
"cell_type": "code",
350328
"execution_count": null,
351-
"metadata": {
352-
"collapsed": false
353-
},
329+
"metadata": {},
354330
"outputs": [],
355331
"source": [
356332
"fig, ax = plt.subplots(figsize=(12,3))\n",
@@ -371,9 +347,7 @@
371347
{
372348
"cell_type": "code",
373349
"execution_count": null,
374-
"metadata": {
375-
"collapsed": false
376-
},
350+
"metadata": {},
377351
"outputs": [],
378352
"source": [
379353
"res_filardo.expected_durations[0].plot(\n",
@@ -390,23 +364,23 @@
390364
],
391365
"metadata": {
392366
"kernelspec": {
393-
"display_name": "Python 2",
367+
"display_name": "Python 3",
394368
"language": "python",
395-
"name": "python2"
369+
"name": "python3"
396370
},
397371
"language_info": {
398372
"codemirror_mode": {
399373
"name": "ipython",
400-
"version": 2
374+
"version": 3
401375
},
402376
"file_extension": ".py",
403377
"mimetype": "text/x-python",
404378
"name": "python",
405379
"nbconvert_exporter": "python",
406-
"pygments_lexer": "ipython2",
407-
"version": "2.7.6"
380+
"pygments_lexer": "ipython3",
381+
"version": "3.6.6"
408382
}
409383
},
410384
"nbformat": 4,
411-
"nbformat_minor": 0
385+
"nbformat_minor": 1
412386
}

0 commit comments

Comments
 (0)