getting df correctly

#40
by jfiel5 - opened
Files changed (1) hide show
  1. app.py +19 -10
app.py CHANGED
@@ -77,17 +77,26 @@ st.text('Chart A Future Edits: Order bars by mean YTD Gross, Make all position t
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
 
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
+
81
  df_jcopy = df_j.copy()
82
+
83
+
84
+ df_jcopy['Period Pay Rate'] = df_jcopy['Period Pay Rate'].str.replace(",", "").astype(int)
85
+ df_jcopy['YTD Gross'] = df_jcopy['YTD Gross'].str.replace(",", "").astype(int)
86
+
87
+
88
+ df_jcopy = df_jcopy.dropna()
89
+ df_jcopy = df_jcopy[df_jcopy['YTD Gross'] != 0]
90
+
91
+
92
+ df_jcopy['Agency'] = df_jcopy['Agency'].str.lower()
93
+ df_jcopy['Agency Division'] = df_jcopy['Agency Division'].str.lower()
94
+ df_jcopy['Employee Name'] = df_jcopy['Employee Name'].str.lower()
95
+ df_jcopy['Position Title'] = df_jcopy['Position Title'].str.lower()
96
+
97
+
98
+ df_jcopy.columns = df_jcopy.columns.str.strip()
99
+
100
 
101
  import altair as alt
102
  import pandas as pd