Spaces:
Running
Running
fix bug in dataframe cleaning
Browse files- clients.py +10 -3
clients.py
CHANGED
@@ -5,6 +5,10 @@ Created on Mon Jan 1 11:20:18 2024
|
|
5 |
@author: mohanadafiffy
|
6 |
"""
|
7 |
import os
|
|
|
|
|
|
|
|
|
8 |
import streamlit as st
|
9 |
import pandas as pd
|
10 |
import requests
|
@@ -117,7 +121,8 @@ def CompanySpecificClient(email_receiver):
|
|
117 |
df = df.drop_duplicates(subset="Website", keep='first')
|
118 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
119 |
|
120 |
-
df = df.dropna(
|
|
|
121 |
df=add_https_to_urls(df, 'Website')
|
122 |
st.write(df)
|
123 |
# Convert DataFrame to CSV for transmission
|
@@ -204,7 +209,8 @@ def UserSpecificClient(email_receiver):
|
|
204 |
df=add_https_to_urls(df, 'Website')
|
205 |
|
206 |
# Convert DataFrame to CSV for transmission
|
207 |
-
df = df.dropna(
|
|
|
208 |
st.write(df)
|
209 |
csv = df.to_csv(index=False)
|
210 |
|
@@ -329,7 +335,8 @@ def RengagmentEmail(email_receiver):
|
|
329 |
# Use the session state variable to determine if the button was previously clicked
|
330 |
if submitted_emails and input_data_emails is not None:
|
331 |
df = input_data_emails
|
332 |
-
df = df.dropna(
|
|
|
333 |
|
334 |
st.write(df)
|
335 |
|
|
|
5 |
@author: mohanadafiffy
|
6 |
"""
|
7 |
import os
|
8 |
+
from dotenv import load_dotenv
|
9 |
+
|
10 |
+
# Load environment variables from a .env file
|
11 |
+
load_dotenv()
|
12 |
import streamlit as st
|
13 |
import pandas as pd
|
14 |
import requests
|
|
|
121 |
df = df.drop_duplicates(subset="Website", keep='first')
|
122 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
123 |
|
124 |
+
df = df.dropna(how='all')
|
125 |
+
df = df.loc[~(df == '').all(axis=1)]
|
126 |
df=add_https_to_urls(df, 'Website')
|
127 |
st.write(df)
|
128 |
# Convert DataFrame to CSV for transmission
|
|
|
209 |
df=add_https_to_urls(df, 'Website')
|
210 |
|
211 |
# Convert DataFrame to CSV for transmission
|
212 |
+
df = df.dropna(how='all')
|
213 |
+
df = df.loc[~(df == '').all(axis=1)]
|
214 |
st.write(df)
|
215 |
csv = df.to_csv(index=False)
|
216 |
|
|
|
335 |
# Use the session state variable to determine if the button was previously clicked
|
336 |
if submitted_emails and input_data_emails is not None:
|
337 |
df = input_data_emails
|
338 |
+
df = df.dropna(how='all')
|
339 |
+
df = df.loc[~(df == '').all(axis=1)]
|
340 |
|
341 |
st.write(df)
|
342 |
|