Spaces:
Sleeping
Sleeping
Update index.py
Browse files
index.py
CHANGED
@@ -24,6 +24,12 @@ df = pd.read_csv(url)
|
|
24 |
|
25 |
df['date'] = pd.to_datetime(df['date'])
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
df = df.rename(columns={df.columns[4]: "Veículos de notícias"})
|
28 |
|
29 |
df['FinBERT_label'] = df['FinBERT_label'].astype(str)
|
@@ -33,11 +39,7 @@ df['FinBERT_label'].replace({
|
|
33 |
'1.0': 'negative'
|
34 |
}, inplace=True)
|
35 |
|
36 |
-
unique_domains = df['domain_folder_name'].unique()
|
37 |
-
print(unique_domains)
|
38 |
|
39 |
-
unique_topics = df['Topic'].unique()
|
40 |
-
print(unique_topics)
|
41 |
|
42 |
counts = df.groupby(['date', 'Topic', 'Veículos de notícias', 'FinBERT_label']).size().reset_index(name='count')
|
43 |
counts['count'] = counts['count'].astype('float64')
|
|
|
24 |
|
25 |
df['date'] = pd.to_datetime(df['date'])
|
26 |
|
27 |
+
unique_domains = df['domain_folder_name'].unique()
|
28 |
+
print(unique_domains)
|
29 |
+
|
30 |
+
unique_topics = df['Topic'].unique()
|
31 |
+
print(unique_topics)
|
32 |
+
|
33 |
df = df.rename(columns={df.columns[4]: "Veículos de notícias"})
|
34 |
|
35 |
df['FinBERT_label'] = df['FinBERT_label'].astype(str)
|
|
|
39 |
'1.0': 'negative'
|
40 |
}, inplace=True)
|
41 |
|
|
|
|
|
42 |
|
|
|
|
|
43 |
|
44 |
counts = df.groupby(['date', 'Topic', 'Veículos de notícias', 'FinBERT_label']).size().reset_index(name='count')
|
45 |
counts['count'] = counts['count'].astype('float64')
|