Skip to content

Commit

Permalink
add changes to show financial impact
Browse files Browse the repository at this point in the history
  • Loading branch information
richiecroker committed Sep 14, 2023
1 parent 2a18954 commit 5513e3e
Show file tree
Hide file tree
Showing 18 changed files with 248,723 additions and 458,616 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bq-service-account.json

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM ebmdatalab/datalab-jupyter:python3.8.1-2328e31e7391a127fe7184dcce38d581a17b
# Set up jupyter environment
ENV MAIN_PATH=/home/app/notebook

# Set path to BQ service account credentials
ENV EBMDATALAB_BQ_CREDENTIALS_PATH=/tmp/bq-service-account.json

# Install pip requirements
COPY requirements.txt /tmp/
# Hack until this is fixed https://github.com/jazzband/pip-tools/issues/823
Expand All @@ -18,3 +21,7 @@ COPY config/kernel.json /tmp/kernel_with_custom_path/kernel.json
RUN jupyter kernelspec install /tmp/kernel_with_custom_path/ --user --name="python3"

CMD cd ${MAIN_PATH} && PYTHONPATH=${MAIN_PATH} jupyter lab --config=config/jupyter_notebook_config.py

# Copy BQ service account credentials into container
# We work around the credentials not existing in CI with the glob
COPY bq-service-account.jso[n] /tmp/
81 changes: 81 additions & 0 deletions Untitled1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 76,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import lxml\n",
"url = 'https://www.nhsbsa.nhs.uk/prescription-data/understanding-our-data/financial-forecasting'\n",
"dfs = pd.read_html(url,match='National Average Discount Percentage')\n",
"nadp = []\n",
"for i in range(len(dfs)):\n",
" nadp.append(dfs[i])\n",
"nadp = pd.concat(nadp)\n"
]
},
{
"cell_type": "code",
"execution_count": 77,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Used for Reports in National Average Discount Percentage\n",
"0 May 23 5.83\n",
"1 Apr 23 5.87\n",
"0 Mar 23 6.26\n",
"1 Feb 23 6.25\n",
"2 Jan 23 6.31\n",
".. ... ...\n",
"7 Aug 14 7.58\n",
"8 Jul 14 7.52\n",
"9 Jun 14 7.65\n",
"10 May 14 7.58\n",
"11 Apr 14 7.66\n",
"\n",
"[110 rows x 2 columns]\n"
]
}
],
"source": [
"print(nadp)"
]
}
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "all",
"notebook_metadata_filter": "all,-language_info",
"text_representation": {
"extension": ".py",
"format_name": "light",
"format_version": "1.5",
"jupytext_version": "1.3.3"
}
},
"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.8.1"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
1 change: 1 addition & 0 deletions data/.tariff.csv.7772cca87e2bdb9915f82cbd881818d5.tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
File created by /root/.pyenv/versions/3.8.1/lib/python3.8/site-packages/ebmdatalab/bq.py
24 changes: 12 additions & 12 deletions data/annual_profile_df.csv
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
mon,proportion
7,0.998019361116844
6,1.0011445161388608
12,1.020719747207815
9,0.983024391120719
11,1.0103182599728644
5,1.0132683003697376
2,0.9300136715235
1,1.0210364502878688
8,1.018761368914048
10,1.0180766373390042
4,0.9743263654749805
3,1.0112909305361506
12,1.020719748393862
9,0.9830243887130287
5,1.0132683015464579
2,0.930013672601688
1,1.0210364514741121
4,0.9743263630566492
6,1.0011445173009053
11,1.0103182611460548
3,1.0112909317104446
7,0.9980193622754345
8,1.0187613665492745
10,1.0180766349736152
6 changes: 6 additions & 0 deletions data/nadp_fixed.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
month,nadp
2023-02-01,6.25
2023-01-01,6.31
2022-12-01,6.51
2022-11-01,6.50
2022-10-01,6.62
2022-09-01,6.53
2022-08-01,6.55
2022-07-01,6.5
2022-06-01,6.45
Expand Down
Loading

0 comments on commit 5513e3e

Please sign in to comment.