lunarflu HF staff commited on
Commit
459c6ce
1 Parent(s): 2a8528e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -59,8 +59,7 @@ print(type(global_df))
59
  community_global_df = pd.DataFrame()
60
  community_global_df_with_id = pd.DataFrame()
61
  community_global_df_gradio = pd.DataFrame()
62
- csv_url = "https://docs.google.com/spreadsheets/d/1C8aLqgCqLYcMiIFf-P_Aosaa03C_WLIB_UyqvjSdWg8/export?format=csv&gid=0"
63
- test_merge = pd.read_csv(csv_url)
64
  data = pd.read_csv("https://docs.google.com/spreadsheets/d/1hQSsIg1Y9WdBF_CdNM1L1rUUREoxKqRTe3_ILo-WK8w/export?format=csv&gid=0")
65
  data2 = pd.read_csv("https://docs.google.com/spreadsheets/d/1T_twNONDSZ8zw7aDcYhw92DlawqPktti1xFw9ssJ13Y/export?format=csv&gid=0")
66
 
@@ -735,6 +734,10 @@ def run_bot():
735
  threading.Thread(target=run_bot).start()
736
 
737
 
 
 
 
 
738
  def get_data():
739
  try:
740
  return community_global_df_gradio
@@ -761,7 +764,7 @@ with demo:
761
  column_values_unique = sorted(dataframe1.iloc[:, 3].unique())
762
  dataframe2 = pd.DataFrame({'Levels': column_values_unique})
763
  counts = {}
764
- for value in test_merge.iloc[:, 3]:
765
  counts[value] = counts.get(value, 0) + 1
766
  dataframe2['Members'] = dataframe2['Levels'].map(counts)
767
 
 
59
  community_global_df = pd.DataFrame()
60
  community_global_df_with_id = pd.DataFrame()
61
  community_global_df_gradio = pd.DataFrame()
62
+ test_merge = pd.read_csv("https://docs.google.com/spreadsheets/d/1C8aLqgCqLYcMiIFf-P_Aosaa03C_WLIB_UyqvjSdWg8/export?format=csv&gid=0")
 
63
  data = pd.read_csv("https://docs.google.com/spreadsheets/d/1hQSsIg1Y9WdBF_CdNM1L1rUUREoxKqRTe3_ILo-WK8w/export?format=csv&gid=0")
64
  data2 = pd.read_csv("https://docs.google.com/spreadsheets/d/1T_twNONDSZ8zw7aDcYhw92DlawqPktti1xFw9ssJ13Y/export?format=csv&gid=0")
65
 
 
734
  threading.Thread(target=run_bot).start()
735
 
736
 
737
+ URL = "https://docs.google.com/spreadsheets/d/1hQSsIg1Y9WdBF_CdNM1L1rUUREoxKqRTe3_ILo-WK8w/edit#gid=0"
738
+ csv_url = URL.replace('/edit#gid=', '/export?format=csv&gid=')
739
+
740
+
741
  def get_data():
742
  try:
743
  return community_global_df_gradio
 
764
  column_values_unique = sorted(dataframe1.iloc[:, 3].unique())
765
  dataframe2 = pd.DataFrame({'Levels': column_values_unique})
766
  counts = {}
767
+ for value in data.iloc[:, 3]:
768
  counts[value] = counts.get(value, 0) + 1
769
  dataframe2['Members'] = dataframe2['Levels'].map(counts)
770