chore(code): Move dataframe generation to module

This commit is contained in:
Marty Oehme 2024-07-15 21:12:39 +02:00
parent 38254d1605
commit 284a3b9281
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
3 changed files with 32 additions and 15 deletions

View file

@ -38,12 +38,25 @@ crossref: # to fix the appendix crossrefs being separate from main
latex-list-of-description: Appendix B Table
---
```{python}
#| label: prep-data
#| label: standard-imports
#| echo: false
#| output: false
{{< include 01-codechunks/_prep-data.py >}}
import src.globals as g
from IPython.display import display, Markdown, HTML
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from tabulate import tabulate
import seaborn as sns
sns.set_style("whitegrid")
```
```{python}
#| label: load-dataframes
#| echo: false
#| output: false
from src.process.generate_dataframes import df, df_by_intervention, validities
```
{{< portrait >}}

View file

@ -22,10 +22,24 @@ crossref:
---
```{python}
#| label: prep-data
#| label: standard-imports
#| echo: false
#| output: false
{{< include 01-codechunks/_prep-data.py >}}
import src.globals as g
from IPython.display import display, Markdown, HTML
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from tabulate import tabulate
import seaborn as sns
sns.set_style("whitegrid")
```
```{python}
#| label: load-dataframes
#| echo: false
#| output: false
from src.process.generate_dataframes import df, df_by_intervention, validities
```
<!-- pagebreak to separate from TOC -->

View file

@ -1,18 +1,8 @@
from pathlib import Path
import os
import re
## standard imports
from IPython.display import display, Markdown, HTML
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
from tabulate import tabulate
import bibtexparser
import src.globals as g
sns.set_style("whitegrid")
## Creates 3 important data structures:
# df: The main dataframe containing all final sample studies
# df_by_intervention: The same dataframe but split up by individual interventions per study