Skip to content

Instantly share code, notes, and snippets.

@saimn
Created December 7, 2016 21:09
Show Gist options
  • Save saimn/99c59daf04866fea1bf7359f9dbe74d9 to your computer and use it in GitHub Desktop.
Save saimn/99c59daf04866fea1bf7359f9dbe74d9 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"from astropy.table import Table, Column"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"t = Table(names=('a', 'b'), data=[list('azertyuiopqsdfghjk'), list(range(18))])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"data = np.arange(len(t), dtype=float)\n",
"data[[1, 4, 7, 9]] = np.nan\n",
"data[[6, 10, 14]] = np.inf\n",
"t.add_column(Column(name='foo', data=data))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"t.show_in_browser(jsviewer=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"t.show_in_notebook(display_length=10)"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment