Spaces:
Runtime error
Runtime error
zaursamedov1
commited on
Commit
•
401c3ed
1
Parent(s):
f49916f
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -2,32 +2,29 @@ import pandas as pd
|
|
2 |
import numpy as np
|
3 |
import plotly.graph_objects as go
|
4 |
import gradio as gr
|
5 |
-
import
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
'INSTITUTIONAL_INVESTORS_SCORE.csv',
|
14 |
-
'/home/user/app/INSTITUTIONAL_INVESTORS_SCORE.csv',
|
15 |
-
'/content/INSTITUTIONAL_INVESTORS_SCORE.csv',
|
16 |
-
os.path.join(os.getcwd(), 'INSTITUTIONAL_INVESTORS_SCORE.csv')
|
17 |
-
]
|
18 |
-
|
19 |
-
df = None
|
20 |
-
for location in possible_locations:
|
21 |
-
try:
|
22 |
-
print(f"Trying to read from: {location}")
|
23 |
-
df = pd.read_csv(location)
|
24 |
-
print(f"Successfully read from: {location}")
|
25 |
-
break
|
26 |
-
except FileNotFoundError:
|
27 |
-
print(f"File not found at: {location}")
|
28 |
-
|
29 |
-
if df is None:
|
30 |
-
raise FileNotFoundError("Could not find the CSV file in any of the expected locations.")
|
31 |
|
32 |
# Clean the data
|
33 |
df = df.dropna(subset=['final_score'])
|
|
|
2 |
import numpy as np
|
3 |
import plotly.graph_objects as go
|
4 |
import gradio as gr
|
5 |
+
from io import StringIO
|
6 |
|
7 |
+
# Embed the CSV data directly in the code
|
8 |
+
csv_data = '''cik,institution,final_score,long_term_performance_score,conviction_and_strategy_score,research_quality_and_adaptability_score,influence_and_governance_score,top_holdings_performance_score
|
9 |
+
0001843237,CEPHEI CAPITAL MANAGEMENT (HONG KONG) LTD,36,14,11,7,3,1
|
10 |
+
0001407024,NNS HOLDING,24,5,8,5,4,2
|
11 |
+
0001451928,SAC CAPITAL ADVISORS LP,50,20,10,12,6,2
|
12 |
+
0001905393,"PCG WEALTH ADVISORS, LLC",68,25,15,14,11,3
|
13 |
+
0001425362,"WHITE RIVER INVESTMENT PARTNERS, LLC",31,7,10,8,4,2
|
14 |
+
0001730210,"TRH FINANCIAL, LLC",72,28,16,15,10,3
|
15 |
+
0001165880,MONTPELIER RE HOLDINGS LTD,68,25,18,12,10,3
|
16 |
+
0001352776,REGIS MANAGEMENT CO LLC,73,28,17,14,11,3
|
17 |
+
0001582272,"BATTERY GLOBAL ADVISORS, LLC",65,22,16,14,10,3
|
18 |
+
0001466715,TRISHIELD CAPITAL MANAGEMENT LLC,59,18,,,,
|
19 |
+
0001092688,IBBOTSON ASSOCIATES INC,69,28,16,12,10,3
|
20 |
+
0001054880,HUTCHENS INVESTMENT MANAGEMENT INC,69,25,,,,3
|
21 |
+
0001650781,AXAR CAPITAL MANAGEMENT L.P.,51,16,14,12,6,3
|
22 |
+
0001425160,MERCHANTS' GATE CAPITAL LP,55,23,12,10,8,2
|
23 |
+
0001921487,"BEACON CAPITAL MANAGEMENT, LLC",78,25,22,15,12,4
|
24 |
+
'''
|
25 |
|
26 |
+
# Load the data from the embedded CSV string
|
27 |
+
df = pd.read_csv(StringIO(csv_data))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
# Clean the data
|
30 |
df = df.dropna(subset=['final_score'])
|