Exemplo n.º 1
0
from Main import get_outcome_lvl1
import pandas as pd

# get group2 mean data
group2mean = get_outcome_lvl1("Data4")
group2mean_df = pd.DataFrame(group2mean)

# name each column (number depends on outcome number)
group2mean_df.columns = [
    "out_g2_mean_" + '{}'.format(column + 1)
    for column in group2mean_df.columns
]

# fill blanks with NA
group2mean_df.fillna("NA", inplace=True)

# remove problematic text
group2mean_df = group2mean_df.replace(r'^\s*$', "NA", regex=True)

# get outcometypeId data
outcomeid = get_outcome_lvl1("OutcomeTypeId")
outcometypeid_df = pd.DataFrame(outcomeid)

# name each column (number depends on outcome number)
outcometypeid_df.columns = [
    "outcometype_df_" + '{}'.format(column + 1)
    for column in outcometypeid_df.columns
]

mask = pd.DataFrame(outcometypeid_df["outcometype_df_1"] == 0)
mask.columns = ["mask"]
from Main import load_json, get_outcome_lvl1
import pandas as pd

# load json file
load_json()

# get outcome ID data
outcome_ID = get_outcome_lvl1("OutcomeId")
outcome_ID_df = pd.DataFrame(outcome_ID)

# name each column (number depends on outcome number)
outcome_ID_df.columns = [
    "Outcome_ID_" + '{}'.format(column + 1) for column in outcome_ID_df.columns
]

# fill blanks with NA
outcome_ID_df.fillna("NA", inplace=True)

# replace problematic text
outcome_ID_df = outcome_ID_df.replace(r'^\s*$', "NA", regex=True)

# save to disk
""" outcome_ID_df.to_csv("outcomeID.csv", index=False) """
Exemplo n.º 3
0
from Main import get_outcome_lvl1
import pandas as pd

# extract confidence interval lower data
cilowersmd = get_outcome_lvl1("CILowerSMD")
cilowersmd_df = pd.DataFrame(cilowersmd)

# round data to 4 decimal places
cilowersmd_df = cilowersmd_df.applymap(
    lambda x: round(x, 4) if isinstance(x, (int, float)) else x)

# name each column (number depends on outcome number)
cilowersmd_df.columns=[
    "ci_lower_"+'{}'.format(column+1) for column in cilowersmd_df.columns]

# fill blanks with NA
cilowersmd_df.fillna("NA", inplace=True)

# replace problematic text
cilowersmd_df = cilowersmd_df.replace(r'^\s*$', "NA", regex=True)

# save to disk
cilowersmd_df.to_csv("cilowersmd.csv", index=False)
Exemplo n.º 4
0
from Main import load_json, get_outcome_lvl1
import pandas as pd

# load json file
load_json()

# get outcome comparison data
out_comp = get_outcome_lvl1("ControlText")
out_comp_df = pd.DataFrame(out_comp)

# name each column (number depends on outcome number)
out_comp_df.columns = [
    "out_comp_" + '{}'.format(column + 1) for column in out_comp_df.columns
]

# fill blanks with NA
out_comp_df.fillna("NA", inplace=True)

# save to disk
""" out_comp_df.to_csv("out_compe.csv", index=False) """
from Main import load_json, get_outcome_lvl1
import pandas as pd

# load json file
load_json()

# get outcome measure data
outcome_measure = get_outcome_lvl1("InterventionText")
outcome_measure_df = pd.DataFrame(outcome_measure)

# name each column (number depends on outcome number)
outcome_measure_df.columns = [
    "out_measure_" + '{}'.format(column + 1)
    for column in outcome_measure_df.columns
]

# fill blanks with NA
outcome_measure_df.fillna("NA", inplace=True)

# remove problematic text
outcome_measure_df = outcome_measure_df.replace(r'^\s*$', "NA", regex=True)

# save to disk
""" outcome_measure_df.to_csv("outcome_measure.csv", index=False) """
Exemplo n.º 6
0
from Main import get_outcome_lvl1
import pandas as pd

# get group 1 N data
group2n = get_outcome_lvl1("Data2")
group2N_df = pd.DataFrame(group2n)

# name each column (number depends on outcome number)
group2N_df.columns = [
    "out_g2_n_" + '{}'.format(column + 1) for column in group2N_df.columns
]

# fill blanks with NA
group2N_df.fillna("NA", inplace=True)

# remove problematic text
group2N_df = group2N_df.replace(r'^\s*$', "NA", regex=True)

# get outcometypeId data (to check)
outcomeid = get_outcome_lvl1("OutcomeTypeId")
outcometypeid_df = pd.DataFrame(outcomeid)

# name each column (number depends on outcome number)
outcometypeid_df.columns = [
    "outcometype_df_" + '{}'.format(column + 1)
    for column in outcometypeid_df.columns
]

mask = pd.DataFrame(outcometypeid_df["outcometype_df_1"] == 0)
mask.columns = ["mask"]
mask = mask.iloc[:, 0]
Exemplo n.º 7
0
from Main import get_outcome_lvl1
import pandas as pd

# get group1 sd data
group1sd = get_outcome_lvl1("Data5")
group1sd_df = pd.DataFrame(group1sd)

# name each column (number depends on outcome number)
group1sd_df.columns = [
    "out_g1_sd_"+'{}'.format(column+1) for column in group1sd_df.columns]

# fill blanks with NA  
group1sd_df.fillna("NA", inplace=True)

# remove problematic text
group1sd_df = group1sd_df.replace(r'^\s*$', "NA", regex=True)

# get outcometypeId data (to check)
getoucomeid = get_outcome_lvl1("OutcomeTypeId")
outcometypeid_df = pd.DataFrame(getoucomeid)

# name each column (number depends on outcome number)
outcometypeid_df.columns = [
    "outcometype_df_"+'{}'.format(column+1) for column in outcometypeid_df.columns]

mask = pd.DataFrame(outcometypeid_df["outcometype_df_1"] == 0)
mask.columns=["mask"]
mask = mask.iloc[:, 0]

# replace all 0 instances (null data) with "NA"
for col in group1sd_df.columns:
Exemplo n.º 8
0
from Main import load_json, get_outcome_lvl1
import pandas as pd

# load json file
load_json()

# get sesmd data
sesmd = get_outcome_lvl1("SESMD")
sesmd_df = pd.DataFrame(sesmd)

# round data to 4 decimal places
sesmd_df = sesmd_df.applymap(lambda x: round(x, 4)
                             if isinstance(x, (int, float)) else x)

# name each column (number depends on outcome number)
sesmd_df.columns = [
    "se_" + '{}'.format(column + 1) for column in sesmd_df.columns
]

# fill blanks with NA
sesmd_df.fillna("NA", inplace=True)

# replace problematic text
sesmd_df = sesmd_df.replace(r'^\s*$', "NA", regex=True)

# save to disk
""" sesmd_df.to_csv("sesmd.csv", index=False) """
from Main import load_json, get_outcome_lvl1
import pandas as pd

# load json file
load_json()

# get outcome title data
outcome_title = get_outcome_lvl1("Title")
outcome_title_df = pd.DataFrame(outcome_title)

# name each column (number depends on outcome number)
outcome_title_df.columns = [
    "out_tit_" + '{}'.format(column + 1) for column in outcome_title_df.columns
]
""" outcome_label_text_df.fillna("NA", inplace=True) """

# replace problematic text
outcome_title_df = outcome_title_df.replace(r'^\s*$', "NA", regex=True)

# save to disk
""" outcome_title_df.to_csv("out_tit.csv", index=False) """
Exemplo n.º 10
0
from Main import load_json, get_outcome_lvl1
import pandas as pd

# load json file
load_json()

# get outcome description data
outcome_description = get_outcome_lvl1("OutcomeDescription")
outcome_description_df = pd.DataFrame(outcome_description)

# name each column (number depends on outcome number)
outcome_description_df.columns = [
    "out_desc_" + '{}'.format(column + 1)
    for column in outcome_description_df.columns
]
""" outcome_description_df = outcome_description_df.fillna("NA") """

outcome_description_df = outcome_description_df.replace(r'^\s*$',
                                                        "NA",
                                                        regex=True)

# replace problematic text
outcome_description_df.replace('\r', ' ', regex=True, inplace=True)
outcome_description_df.replace('\n', ' ', regex=True, inplace=True)
outcome_description_df.replace(':', ' ', regex=True, inplace=True)
outcome_description_df.replace(';', ' ', regex=True, inplace=True)

# save to disk
""" outcome_description_df.to_csv("outcomedescription.csv", index=False) """
Exemplo n.º 11
0
from Main import load_json, get_outcome_lvl1
import pandas as pd

# load json file
load_json()

# get outcome data
outcome = get_outcome_lvl1("OutcomeText")
outcome_df = pd.DataFrame(outcome)

# name each column (number depends on outcome number)
outcome_df.columns = [
    "out_label_" + '{}'.format(column + 1) for column in outcome_df.columns
]

# fill blanks with NA
outcome_df.fillna("NA", inplace=True)

# save to disk
""" outcome_df.to_csv("outcome.csv", index=False) """