Spaces:
Build error
Build error
Commit ·
b4b05bc
1
Parent(s): cea9f1e
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,10 +6,12 @@ sns.set_palette("pastel")
|
|
| 6 |
sns.set_style("darkgrid")
|
| 7 |
import re
|
| 8 |
|
|
|
|
| 9 |
# import unicodedata
|
| 10 |
# plt.rcParams['font.family'] = 'DejaVu Sans'
|
| 11 |
-
plt.rcParams['font.family'] = 'Segoe UI Emoji'
|
| 12 |
-
plt.rcParams['font.family'] = '
|
|
|
|
| 13 |
from wordcloud import WordCloud
|
| 14 |
|
| 15 |
|
|
@@ -57,19 +59,6 @@ if uploaded_file is not None:
|
|
| 57 |
data = bytes_data.decode('utf-8')
|
| 58 |
df = preprocess.preprocess(data)
|
| 59 |
st.dataframe(df)
|
| 60 |
-
# df['extracted_value'] = df['sender'].apply(lambda x: re.findall(r'^(.*):.*added you', x)[0] if re.findall(r'added you', x) else '')
|
| 61 |
-
|
| 62 |
-
# Remove rows with empty 'extracted_value'
|
| 63 |
-
# df = df[df['extracted_value'] != '']
|
| 64 |
-
# print(df['extracted_value'])
|
| 65 |
-
# df.drop(df[df['extracted_value'] == ''].index, inplace=True)
|
| 66 |
-
|
| 67 |
-
# Reset the index if needed
|
| 68 |
-
# df.reset_index(drop=True, inplace=True)
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
# Reset the index if needed
|
| 72 |
-
# df.reset_index(drop=True, inplace=True)
|
| 73 |
|
| 74 |
user_list = df['sender'].unique().tolist()
|
| 75 |
# user_list.remove('Haldi Mehendi -Dance prep')
|
|
@@ -145,26 +134,7 @@ if uploaded_file is not None:
|
|
| 145 |
# print(x)
|
| 146 |
x = x[1:]
|
| 147 |
# print(x)['First'][0]
|
| 148 |
-
# print('This')
|
| 149 |
-
|
| 150 |
-
# first_row_element = x.iloc[0, 0]
|
| 151 |
-
|
| 152 |
-
# Check if the element is an empty string or "nothing"
|
| 153 |
-
# if not first_row_element:
|
| 154 |
-
# print("The element is empty or represents 'nothing'")
|
| 155 |
-
# else:
|
| 156 |
-
# Get the Unicode code point value
|
| 157 |
-
# code_point = ord(first_row_element)
|
| 158 |
-
# Get the character name using Unicode code point
|
| 159 |
-
# char_name = unicodedata.name(first_row_element)
|
| 160 |
-
|
| 161 |
-
# print(f"The element represents the character '{first_row_element}'")
|
| 162 |
-
# print(f"Unicode code point: {code_point}")
|
| 163 |
-
# print(f"Character name: {char_name}")
|
| 164 |
-
|
| 165 |
|
| 166 |
-
# print(x.iloc[0, 0])
|
| 167 |
-
# x = x.iloc[4:, :]
|
| 168 |
fig, ax = plt.subplots()
|
| 169 |
|
| 170 |
col1 = st.columns(1)[0]
|
|
|
|
| 6 |
sns.set_style("darkgrid")
|
| 7 |
import re
|
| 8 |
|
| 9 |
+
|
| 10 |
# import unicodedata
|
| 11 |
# plt.rcParams['font.family'] = 'DejaVu Sans'
|
| 12 |
+
# plt.rcParams['font.family'] = 'Segoe UI Emoji'
|
| 13 |
+
# plt.rcParams['font.family'] = 'Noto Sans Devanagari'
|
| 14 |
+
# plt.rcParams['font.family'] = 'Twemoji'
|
| 15 |
from wordcloud import WordCloud
|
| 16 |
|
| 17 |
|
|
|
|
| 59 |
data = bytes_data.decode('utf-8')
|
| 60 |
df = preprocess.preprocess(data)
|
| 61 |
st.dataframe(df)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
user_list = df['sender'].unique().tolist()
|
| 64 |
# user_list.remove('Haldi Mehendi -Dance prep')
|
|
|
|
| 134 |
# print(x)
|
| 135 |
x = x[1:]
|
| 136 |
# print(x)['First'][0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
|
|
|
|
|
|
|
| 138 |
fig, ax = plt.subplots()
|
| 139 |
|
| 140 |
col1 = st.columns(1)[0]
|