capitalizing my words

#39
by jfiel5 - opened
Files changed (1) hide show
  1. app.py +20 -3
app.py CHANGED
@@ -72,6 +72,23 @@ st.text('Overall Future Edits: Figure out what to do with positions with 1 emplo
72
  st.text('Chart A Future Edits: Order bars by mean YTD Gross, Make all position titles readable, add title')
73
 
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  import altair as alt
76
  import pandas as pd
77
 
@@ -119,11 +136,11 @@ select_bar = alt.selection_point(
119
 
120
 
121
  bar_chart = (
122
- alt.Chart(df_small)
123
  .mark_bar()
124
  .encode(
125
  y=alt.Y("Agency:N", sort="-x"),
126
- x=alt.X("mean(YTD Gross):Q", title="Total Personale Expense"), # <-- take the mean
127
  tooltip=[
128
  "Agency:N",
129
  alt.Tooltip("mean(YTD Gross):Q", title="Avg YTD Gross", format="$,.0f")
@@ -160,7 +177,7 @@ bar_chart = (
160
 
161
 
162
  strip = (
163
- alt.Chart(df)
164
  .mark_circle(size=60, opacity=0.6)
165
  .encode(
166
  x=alt.X("YTD Gross:Q", title="YTD Gross"),
 
72
  st.text('Chart A Future Edits: Order bars by mean YTD Gross, Make all position titles readable, add title')
73
 
74
 
75
+
76
+
77
+ #im just going to relaod the data frame in to clean up the text on the bottomo charts
78
+ df_j = pd.read_csv('State_Employee_Pay.csv')
79
+
80
+ df_jcopy = df_j.copy()
81
+ df['Period Pay Rate'] = df['Period Pay Rate'].str.replace(",", "")
82
+ df['YTD Gross'] = df['YTD Gross'].str.replace(",", "")
83
+ df['Period Pay Rate'] = df['Period Pay Rate'].astype(int)
84
+ df['YTD Gross'] = df['YTD Gross'].astype(int)
85
+ df = df.dropna()
86
+ df = df[df['YTD Gross']!= 0]
87
+ # df['Agency'] = df['Agency'].str.lower()
88
+ # df['Agency Division'] = df['Agency Division'].str.lower()
89
+ # df['Employee Name'] = df['Employee Name'].str.lower()
90
+ # df['Position Title'] = df['Position Title'].str.lower()
91
+
92
  import altair as alt
93
  import pandas as pd
94
 
 
136
 
137
 
138
  bar_chart = (
139
+ alt.Chart(df_jcopy)
140
  .mark_bar()
141
  .encode(
142
  y=alt.Y("Agency:N", sort="-x"),
143
+ x=alt.X("mean(YTD Gross):Q", title="Total Personale Expense"),
144
  tooltip=[
145
  "Agency:N",
146
  alt.Tooltip("mean(YTD Gross):Q", title="Avg YTD Gross", format="$,.0f")
 
177
 
178
 
179
  strip = (
180
+ alt.Chart(df_jcopy)
181
  .mark_circle(size=60, opacity=0.6)
182
  .encode(
183
  x=alt.X("YTD Gross:Q", title="YTD Gross"),