{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import floatview\n",
    "import pandas as pd\n",
    "import requests\n",
    "import io\n",
    "import numpy as np\n",
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "url=\"https://github.com/paradimdata/nsf_2d_workshop_2018/raw/master/SmB6_data/SR-Publication/Figure_S5.xlsx\"\n",
    "tab = pd.read_excel(url)\n",
    "tab = tab.drop([0])\n",
    "for i in range(2, len(tab.columns)):\n",
    "    ccn = tab.columns[i]\n",
    "    cc = tab[ccn].values.astype('str')\n",
    "    for j in range(len(cc)):\n",
    "        cc[j] = re.sub(r'[^0-9\\.]+','',cc[j],re.I)\n",
    "        if cc[j] == \"\":\n",
    "            cc[j] = \"-1\"\n",
    "    tab[ccn] = cc.astype('float')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "gmw = floatview.GlueManagerWidget(tab, modal=True, label=\"\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "gmw.gluemanager.newView(\"composed_scatter\", [\"Atomic Number\", \"Polycrystalline Rod\", \"Cut 1\", \"Cut 2\", \"Cut 3\"], \"CylindersxMPG_exp\");\n",
    "gmw.gluemanager.newView(\"composed_errorbar\", [\"Atomic Number\", \"Polycrystalline Rod\", \"Cut 1\", \"Cut 2\", \"Cut 3\"], \"CylindersxMPG_exp\");\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
