Skip to content

Instantly share code, notes, and snippets.

@kyleabeauchamp
Last active August 29, 2015 13:57
Show Gist options
  • Save kyleabeauchamp/9855675 to your computer and use it in GitHub Desktop.
Save kyleabeauchamp/9855675 to your computer and use it in GitHub Desktop.
Examples for EXPT data
atom resSeq temperature pressure value uncertainty
HA 2 300 1.0 4.0 1.0
atom resSeq temperature pressure value uncertainty
HA 2 300 1.0 4.0 1.0
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import pandas as pd"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"water = pd.read_csv(\"./waterdata.txt\", delim_whitespace=True)\n",
"water[\"system\"] = \"waterbox\"\n",
"water"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>observable</th>\n",
" <th>value</th>\n",
" <th>uncertainty</th>\n",
" <th>temperature</th>\n",
" <th>pressure</th>\n",
" <th>system</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td> diffusion_constant</td>\n",
" <td> 4.8</td>\n",
" <td> 1</td>\n",
" <td> 300</td>\n",
" <td> 1</td>\n",
" <td> waterbox</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows \u00d7 6 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"text": [
" observable value uncertainty temperature pressure system\n",
"0 diffusion_constant 4.8 1 300 1 waterbox\n",
"\n",
"[1 rows x 6 columns]"
]
}
],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"ala3 = pd.read_csv(\"./ala3_chemical_shifts.txt\", delim_whitespace=True)\n",
"ala3[\"system\"] = \"ALA3\"\n",
"ala3[\"observable\"] = \"chemical_shift\"\n",
"ala3"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>atom</th>\n",
" <th>resSeq</th>\n",
" <th>temperature</th>\n",
" <th>pressure</th>\n",
" <th>value</th>\n",
" <th>uncertainty</th>\n",
" <th>system</th>\n",
" <th>observable</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td> HA</td>\n",
" <td> 2</td>\n",
" <td> 300</td>\n",
" <td> 1</td>\n",
" <td> 4</td>\n",
" <td> 1</td>\n",
" <td> ALA3</td>\n",
" <td> chemical_shift</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows \u00d7 8 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 3,
"text": [
" atom resSeq temperature pressure value uncertainty system \\\n",
"0 HA 2 300 1 4 1 ALA3 \n",
"\n",
" observable \n",
"0 chemical_shift \n",
"\n",
"[1 rows x 8 columns]"
]
}
],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"dataset = pd.concat((water, ala3))\n",
"dataset\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>atom</th>\n",
" <th>observable</th>\n",
" <th>pressure</th>\n",
" <th>resSeq</th>\n",
" <th>system</th>\n",
" <th>temperature</th>\n",
" <th>uncertainty</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td> NaN</td>\n",
" <td> diffusion_constant</td>\n",
" <td> 1</td>\n",
" <td>NaN</td>\n",
" <td> waterbox</td>\n",
" <td> 300</td>\n",
" <td> 1</td>\n",
" <td> 4.8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0</th>\n",
" <td> HA</td>\n",
" <td> chemical_shift</td>\n",
" <td> 1</td>\n",
" <td> 2</td>\n",
" <td> ALA3</td>\n",
" <td> 300</td>\n",
" <td> 1</td>\n",
" <td> 4.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>2 rows \u00d7 8 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"text": [
" atom observable pressure resSeq system temperature \\\n",
"0 NaN diffusion_constant 1 NaN waterbox 300 \n",
"0 HA chemical_shift 1 2 ALA3 300 \n",
"\n",
" uncertainty value \n",
"0 1 4.8 \n",
"0 1 4.0 \n",
"\n",
"[2 rows x 8 columns]"
]
}
],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
import pandas as pd
water = pd.read_csv("./waterdata.csv")
water["system"] = "waterbox"
water
ala3 = pd.read_csv("./ala3_chemical_shifts.csv")
ala3["system"] = "ALA3"
ala3["observable"] = "chemical_shift"
dataset = pd.concat((water, ala3))
import pandas as pd
water = pd.read_csv("./waterdata.txt", delim_whitespace=True)
water["system"] = "waterbox"
water
ala3 = pd.read_csv("./ala3_chemical_shifts.txt", delim_whitespace=True)
ala3["system"] = "ALA3"
ala3["observable"] = "chemical_shift"
dataset = pd.concat((water, ala3))
observable value uncertainty temperature pressure
diffusion_constant 4.8 1.0 300 1.
observable value uncertainty temperature pressure
diffusion_constant 4.8 1.0 300 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment