lunarflu HF staff commited on
Commit
2a8528e
·
verified ·
1 Parent(s): b314d76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -59,7 +59,8 @@ 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
- 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,10 +735,6 @@ def run_bot():
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
@@ -760,11 +757,11 @@ def get_data2():
760
  demo = gr.Blocks()
761
  with demo:
762
  try:
763
- dataframe1 = pd.read_csv(test_merge)
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
 
 
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
  threading.Thread(target=run_bot).start()
736
 
737
 
 
 
 
 
738
  def get_data():
739
  try:
740
  return community_global_df_gradio
 
757
  demo = gr.Blocks()
758
  with demo:
759
  try:
760
+ dataframe1 = pd.read_csv(csv_url)
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