Skip to content

Commit

Permalink
bugfix for pandas Series mixin, commenting intentional error in asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Jan 13, 2023
1 parent 8289a5e commit 1ad8a73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
15 changes: 10 additions & 5 deletions 06-Tables/Advanced_Tables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,12 @@
"import pandas as pd\n",
"\n",
"class SeriesMixin(pd.Series):\n",
" info = ParentDtypeInfo()"
" info = ParentDtypeInfo()\n",
"\n",
" def __init__(self, *args, **kwargs):\n",
" name = kwargs.pop('name')\n",
" super().__init__(*args, **kwargs)\n",
" self.info.name = name"
]
},
{
Expand All @@ -1353,8 +1358,8 @@
},
"outputs": [],
"source": [
"s = SeriesMixin((np.arange(5)-2)**2)\n",
"pt = Table([s], names=['s'])"
"s = SeriesMixin((np.arange(5)-2)**2, name='s')\n",
"pt = Table([s])"
]
},
{
Expand Down Expand Up @@ -1433,7 +1438,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.9"
"version": "3.9.13"
},
"nbpresent": {
"slides": {
Expand Down Expand Up @@ -2495,5 +2500,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
13 changes: 3 additions & 10 deletions 12-ASDF/Solutions_intro_asdf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,9 @@
"metadata": {},
"outputs": [],
"source": [
"jw['data'][0,0] = 900"
"# # Uncomment this to see the error:\n",
"# jw['data'][0,0] = 900"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d0375422",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -157,7 +150,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 1ad8a73

Please sign in to comment.