Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
lmmentel committed May 5, 2024
1 parent 0609767 commit e73c96e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions notebooks/glawe-pettifor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv('data/tabula-Glawe2016.csv', header=None).T"
"df = pd.read_csv(\"data/tabula-Glawe2016.csv\", header=None).T"
]
},
{
Expand Down Expand Up @@ -71,7 +71,7 @@
"metadata": {},
"outputs": [],
"source": [
"data = data.set_index('n').dropna()"
"data = data.set_index(\"n\").dropna()"
]
},
{
Expand Down Expand Up @@ -106,6 +106,7 @@
"outputs": [],
"source": [
"from mendeleev import get_session, Element\n",
"\n",
"session = get_session()"
]
},
Expand All @@ -122,7 +123,7 @@
"metadata": {},
"outputs": [],
"source": [
"pn = data['P'].reset_index().set_index('P')"
"pn = data[\"P\"].reset_index().set_index(\"P\")"
]
},
{
Expand Down Expand Up @@ -151,8 +152,8 @@
"source": [
"for i, row in pn.iterrows():\n",
" e = session.query(Element).filter(Element.symbol == i).one()\n",
" print(i, e.symbol, row['n'], e.pettifor_number)\n",
" e.pettifor_number = int(row['n'])\n",
" print(i, e.symbol, row[\"n\"], e.pettifor_number)\n",
" e.pettifor_number = int(row[\"n\"])\n",
" session.add(e)\n",
"session.commit()"
]
Expand All @@ -170,7 +171,7 @@
"metadata": {},
"outputs": [],
"source": [
"gn = data['Pm'].reset_index().set_index('Pm')"
"gn = data[\"Pm\"].reset_index().set_index(\"Pm\")"
]
},
{
Expand Down Expand Up @@ -199,8 +200,8 @@
"source": [
"for i, row in gn.iterrows():\n",
" e = session.query(Element).filter(Element.symbol == i).one()\n",
" print(i, e.symbol, row['n'], e.glawe_number)\n",
" e.glawe_number = int(row['n'])\n",
" print(i, e.symbol, row[\"n\"], e.glawe_number)\n",
" e.glawe_number = int(row[\"n\"])\n",
" session.add(e)\n",
"session.commit()"
]
Expand Down

0 comments on commit e73c96e

Please sign in to comment.