Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -95,40 +95,17 @@ uploaded_file = st.file_uploader("Upload CSV data for analysis", type=['csv'])
|
|
95 |
df1 = ""
|
96 |
sdf = ""
|
97 |
data = [{"Feb 24":"","1.":"Do","2.":"Fr","3.":"Sa","4.":"So","5.":"Mo","6.":"Di","7.":"Mi","8.":"Do","9.":"Fr","10.":"Sa","11.":"So","12.":"Mo","13.":"Di","14.":"Mi","15.":"Do","16.":"Fr","17.":"Sa","18.":"So","19.":"Mo","20.":"Di","21.":"Mi","22.":"Do","23.":"Fr","24.":"Sa","25.":"So","26.":"Mo","27.":"Di","28.":"Mi","29.":"Do"},{"Feb 24":"Standke Steffen","1.":"F","2.":"F","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"","10.":"","11.":"","12.":"","13.":"","14.":"UA","15.":"UA","16.":"","17.":"SD","18.":"SD","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"","25.":"","26.":"","27.":"","28.":"","29.":""},{"Feb 24":"Will Susanne","1.":"","2.":"TZ","3.":"","4.":"","5.":"UA","6.":"","7.":"","8.":"","9.":"TZ","10.":"","11.":"","12.":"","13.":"","14.":"","15.":"","16.":"TZ","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"TZ","24.":"","25.":"","26.":"","27.":"","28.":"","29.":""},{"Feb 24":"Raab Julia","1.":"TZ","2.":"TZ","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"TZ","9.":"TZ","10.":"BLOCKER","11.":"","12.":"Ü","13.":"Ü","14.":"Ü","15.":"TZ","16.":"TZ","17.":"BLOCKER","18.":"","19.":"","20.":"","21.":"","22.":"TZ","23.":"TZ","24.":"","25.":"SD","26.":"","27.":"","28.":"","29.":"TZ"},{"Feb 24":"Eckert Marion","1.":"","2.":"","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"Ü","10.":"","11.":"","12.":"S","13.":"S","14.":"S","15.":"S","16.":"S","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"","25.":"","26.":"S","27.":"S","28.":"S","29.":"S"},{"Feb 24":"Meder, Milena","1.":"","2.":"","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"","10.":"","11.":"","12.":"F","13.":"F","14.":"","15.":"F","16.":"F","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"","25.":"","26.":"Voloreise","27.":"","28.":"","29.":""},{"Feb 24":"Despang Angelika","1.":"","2.":"","3.":"SD","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"","10.":"","11.":"","12.":"UA","13.":"UA","14.":"UA","15.":"","16.":"","17.":"","18.":"","19.":"F","20.":"F","21.":"F","22.":"F","23.":"F","24.":"","25.":"","26.":"","27.":"","28.":"","29.":""},{"Feb 24":"Heike Beudert","1.":"TZ","2.":"0,5 U","3.":"","4.":"","5.":"TZ","6.":"","7.":"","8.":"","9.":"","10.":"SD","11.":"SD","12.":"UA","13.":"UA","14.":"TZ","15.":"TZ","16.":"TZ","17.":"","18.":"","19.":"TZ","20.":"TZ","21.":"TZ","22.":"TZ","23.":"TZ","24.":"","25.":"","26.":"F","27.":"F","28.":"F","29.":"F"},{"Feb 24":"Borst Benedikt","1.":"","2.":"","3.":"","4.":"SD","5.":"F","6.":"F","7.":"F","8.":"F","9.":"F","10.":"BLOCKER","11.":"","12.":"UA","13.":"UA","14.":"F","15.":"","16.":"","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"BLOCKER","25.":"","26.":"","27.":"","28.":"","29.":""}]
|
98 |
-
|
99 |
|
100 |
|
101 |
-
# Erzeuge ein leeres Balkendiagramm
|
102 |
-
fig, ax = plt.subplots()
|
103 |
-
ax.bar(range(len(data['Angestellte'])), [0] * len(data['Angestellte']))
|
104 |
-
|
105 |
-
# Loop durch die Angestellten
|
106 |
-
for i, angestellter in enumerate(data['Angestellte']):
|
107 |
-
fruehschichten = 0
|
108 |
-
# Loop durch die Schichten
|
109 |
-
for schicht in angestellter['Schichten']:
|
110 |
-
if schicht == 'F':
|
111 |
-
fruehschichten += 1
|
112 |
-
# Set the x-value to the index of the angestellter
|
113 |
-
ax.bar(i, fruehschichten)
|
114 |
-
|
115 |
-
# Setze den Titel und die Achsenbeschriftungen
|
116 |
-
ax.set_title('Frühschichten pro Angestellter')
|
117 |
-
ax.set_xlabel('Angestellter')
|
118 |
-
ax.set_ylabel('Anzahl Frühschichten')
|
119 |
-
|
120 |
-
# Zeige das Diagramm
|
121 |
-
st.pyplot(fig)
|
122 |
|
123 |
if uploaded_file is not None:
|
124 |
|
125 |
df1 = pd.read_csv(uploaded_file)
|
126 |
-
|
127 |
#st.bar_chart(df)
|
128 |
-
|
129 |
-
|
130 |
-
)
|
131 |
-
#sdf = SmartDataframe(df1)
|
132 |
#agent = Agent(df)
|
133 |
#result = agent.chat("erstelle balkendiagramm")
|
134 |
#st.write(result)
|
@@ -155,14 +132,14 @@ if st.button("Generate"):
|
|
155 |
with st.spinner("Generating response..."):
|
156 |
|
157 |
bar = st.progress(0)
|
158 |
-
|
159 |
#df
|
160 |
#sdf.chat(prompt)
|
161 |
|
162 |
st.write(sdf.chat(prompt))
|
163 |
-
agent = Agent(df1)
|
164 |
-
result = agent.chat("erstelle balkendiagramm")
|
165 |
-
st.write(result)
|
166 |
|
167 |
#st.write(pandas_ai.run(df1, prompt=prompt))
|
168 |
|
|
|
95 |
df1 = ""
|
96 |
sdf = ""
|
97 |
data = [{"Feb 24":"","1.":"Do","2.":"Fr","3.":"Sa","4.":"So","5.":"Mo","6.":"Di","7.":"Mi","8.":"Do","9.":"Fr","10.":"Sa","11.":"So","12.":"Mo","13.":"Di","14.":"Mi","15.":"Do","16.":"Fr","17.":"Sa","18.":"So","19.":"Mo","20.":"Di","21.":"Mi","22.":"Do","23.":"Fr","24.":"Sa","25.":"So","26.":"Mo","27.":"Di","28.":"Mi","29.":"Do"},{"Feb 24":"Standke Steffen","1.":"F","2.":"F","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"","10.":"","11.":"","12.":"","13.":"","14.":"UA","15.":"UA","16.":"","17.":"SD","18.":"SD","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"","25.":"","26.":"","27.":"","28.":"","29.":""},{"Feb 24":"Will Susanne","1.":"","2.":"TZ","3.":"","4.":"","5.":"UA","6.":"","7.":"","8.":"","9.":"TZ","10.":"","11.":"","12.":"","13.":"","14.":"","15.":"","16.":"TZ","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"TZ","24.":"","25.":"","26.":"","27.":"","28.":"","29.":""},{"Feb 24":"Raab Julia","1.":"TZ","2.":"TZ","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"TZ","9.":"TZ","10.":"BLOCKER","11.":"","12.":"Ü","13.":"Ü","14.":"Ü","15.":"TZ","16.":"TZ","17.":"BLOCKER","18.":"","19.":"","20.":"","21.":"","22.":"TZ","23.":"TZ","24.":"","25.":"SD","26.":"","27.":"","28.":"","29.":"TZ"},{"Feb 24":"Eckert Marion","1.":"","2.":"","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"Ü","10.":"","11.":"","12.":"S","13.":"S","14.":"S","15.":"S","16.":"S","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"","25.":"","26.":"S","27.":"S","28.":"S","29.":"S"},{"Feb 24":"Meder, Milena","1.":"","2.":"","3.":"","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"","10.":"","11.":"","12.":"F","13.":"F","14.":"","15.":"F","16.":"F","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"","25.":"","26.":"Voloreise","27.":"","28.":"","29.":""},{"Feb 24":"Despang Angelika","1.":"","2.":"","3.":"SD","4.":"","5.":"","6.":"","7.":"","8.":"","9.":"","10.":"","11.":"","12.":"UA","13.":"UA","14.":"UA","15.":"","16.":"","17.":"","18.":"","19.":"F","20.":"F","21.":"F","22.":"F","23.":"F","24.":"","25.":"","26.":"","27.":"","28.":"","29.":""},{"Feb 24":"Heike Beudert","1.":"TZ","2.":"0,5 U","3.":"","4.":"","5.":"TZ","6.":"","7.":"","8.":"","9.":"","10.":"SD","11.":"SD","12.":"UA","13.":"UA","14.":"TZ","15.":"TZ","16.":"TZ","17.":"","18.":"","19.":"TZ","20.":"TZ","21.":"TZ","22.":"TZ","23.":"TZ","24.":"","25.":"","26.":"F","27.":"F","28.":"F","29.":"F"},{"Feb 24":"Borst Benedikt","1.":"","2.":"","3.":"","4.":"SD","5.":"F","6.":"F","7.":"F","8.":"F","9.":"F","10.":"BLOCKER","11.":"","12.":"UA","13.":"UA","14.":"F","15.":"","16.":"","17.":"","18.":"","19.":"","20.":"","21.":"","22.":"","23.":"","24.":"BLOCKER","25.":"","26.":"","27.":"","28.":"","29.":""}]
|
98 |
+
df = pd.DataFrame(data)
|
99 |
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
if uploaded_file is not None:
|
103 |
|
104 |
df1 = pd.read_csv(uploaded_file)
|
105 |
+
df1
|
106 |
#st.bar_chart(df)
|
107 |
+
|
108 |
+
sdf = SmartDataframe(df1)
|
|
|
|
|
109 |
#agent = Agent(df)
|
110 |
#result = agent.chat("erstelle balkendiagramm")
|
111 |
#st.write(result)
|
|
|
132 |
with st.spinner("Generating response..."):
|
133 |
|
134 |
bar = st.progress(0)
|
135 |
+
sdf = SmartDataframe(df1)
|
136 |
#df
|
137 |
#sdf.chat(prompt)
|
138 |
|
139 |
st.write(sdf.chat(prompt))
|
140 |
+
#agent = Agent(df1)
|
141 |
+
#result = agent.chat("erstelle balkendiagramm")
|
142 |
+
#st.write(result)
|
143 |
|
144 |
#st.write(pandas_ai.run(df1, prompt=prompt))
|
145 |
|