Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit c0da239

Browse files
changed the way the pickle is loaded to be Python3 compatible
1 parent fb78630 commit c0da239

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

examples/tsodyksmarkramstp/tsodyksmarkramstp.ipynb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,10 @@
828828
"sns.set_style('whitegrid')\n",
829829
"\n",
830830
"# Load and display in vitro trace\n",
831-
"trace = pickle.load(open('trace.pkl'))\n",
831+
"with open('trace.pkl', 'rb') as f:\n",
832+
" u = pickle._Unpickler(f)\n",
833+
" u.encoding = 'latin1'\n",
834+
" trace = u.load()\n",
832835
"fig, ax = plt.subplots()\n",
833836
"ax.plot(trace['t'], trace['v'], label='in vitro')\n",
834837
"ax.legend(loc=0)\n",
@@ -1702,17 +1705,20 @@
17021705
"cell_type": "code",
17031706
"execution_count": null,
17041707
"metadata": {
1705-
"collapsed": true
1708+
"collapsed": true,
1709+
"jupyter": {
1710+
"outputs_hidden": true
1711+
}
17061712
},
17071713
"outputs": [],
17081714
"source": []
17091715
}
17101716
],
17111717
"metadata": {
17121718
"kernelspec": {
1713-
"display_name": "Python 3",
1719+
"display_name": "unstable",
17141720
"language": "python",
1715-
"name": "python3"
1721+
"name": "unstable"
17161722
},
17171723
"language_info": {
17181724
"codemirror_mode": {
@@ -1724,9 +1730,9 @@
17241730
"name": "python",
17251731
"nbconvert_exporter": "python",
17261732
"pygments_lexer": "ipython3",
1727-
"version": "3.7.0"
1733+
"version": "3.8.3"
17281734
}
17291735
},
17301736
"nbformat": 4,
1731-
"nbformat_minor": 2
1737+
"nbformat_minor": 4
17321738
}

0 commit comments

Comments
 (0)