Skip to content

Commit

Permalink
2023.06.01 inkl Nones bei Crosstables
Browse files Browse the repository at this point in the history
  • Loading branch information
OMGToFo authored Jun 2, 2023
1 parent 027404e commit 10cf7be
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,11 @@
if row['Column Name'] in rawData.columns:
rawData.rename(columns={row['Column Name']: row['VariableLabelUnique']}, inplace=True)




st.write(rawData)

if st.checkbox("Show Column Data Types?"):
st.write("Column Data Types")
st.write(rawData.dtypes)



st.write(rawData)

def to_excel(rawData):
output = BytesIO()
writer = pd.ExcelWriter(output, engine='xlsxwriter')
Expand All @@ -131,6 +126,19 @@ def to_excel(rawData):
file_name='SPSSRawDataToExcel.xlsx')



if st.checkbox("Show Column Data Types?"):
st.write("Column Data Types")
st.write(rawData.dtypes)

if st.checkbox("Show Variable descriptions (Max/Min/Mean/Count Values)?"):
st.write("Description of Variables")
st.write(rawData.describe())





# Checkbox for statistical profile reporting ############################
st.write("")
st.write("")
Expand All @@ -147,7 +155,7 @@ def to_excel(rawData):

st.write("")

if st.checkbox("Show simple Chart?"):
if st.checkbox("Create simple Chart?"):
#bygga in en chartmodul här?
#st.write(df_statistischeTestrawData)
averages = df_statistischeTestrawData[my_korrelationsVariablenSelect].mean()
Expand Down Expand Up @@ -273,9 +281,13 @@ def to_excel(rawData):
labelledData.rename(columns={row['Column Name']: row['VariableLabelUnique']}, inplace=True)






st.write(labelledData)

if st.checkbox("Show Column Data Types of labelled data?"):
if st.checkbox("Show Column Data Types of labelled data?", key="labelledData.dtypes"):
st.write(labelledData.dtypes)

def to_excel(labelledData):
Expand Down Expand Up @@ -406,7 +418,7 @@ def to_excel(labelledData):
st.write("selected_categorical_cols:", selected_categorical_cols)

st.markdown("#### Selected Variables and their Labels/Values:")
st.info("None's are deleted. I'll add functionality here if/when i figure out how")

cols = st.columns(anzahlVariablen)

VariablenKolumnenAuswahl = merged_df.columns.values.tolist()
Expand All @@ -416,7 +428,8 @@ def to_excel(labelledData):

dict_of_merged_df= {} # initialize empty dictionary

merged_df = merged_df.dropna(axis = 0, how ='any')
st.info("None's are not deleted, might be a problem. I'll add functionality here if/when i figure out how")
#merged_df = merged_df.dropna(axis = 0, how ='any')

for i in range(anzahlVariablen):
col = cols[i%anzahlVariablen]
Expand Down Expand Up @@ -448,7 +461,7 @@ def to_excel(labelledData):
#st.write(merged_df.dtypes)

if st.checkbox("Create cross-tabulations?"):
st.title("Cross Tables with Average Values")
st.title("Cross Tables with Average Values - Beta")

# Create multiselect widgets for object and float variables
selected_object_vars = selected_categorical_cols
Expand All @@ -470,7 +483,7 @@ def to_excel(labelledData):


st.info(" ")

st.write("Count of cases: ",len(merged_df))

# Group by selected object variables and calculate average values for selected float variables

Expand All @@ -494,7 +507,7 @@ def to_excel(labelledData):
#ThomasFormatiertesDataframe = ThomasFormatiertesDataframe.transpose()

st.write("")
st.write("Table with categries in the columns: ", TransposedDataframe)
st.write("Table with categories in the columns: ", TransposedDataframe)

def to_excel(TransposedDataframe):
output = BytesIO()
Expand Down

0 comments on commit 10cf7be

Please sign in to comment.