File size: 913 Bytes
532c430
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#Aqui añadiremos la conexion entre Supabase y Huggingface

import pandas as pd
from supabase import create_client, Client

#Aqui van las credenciales, conectar las credenciales de Supabase en "Secrets"

#SUPABASE_URL = 
#SUPABASE_KEY = 

def load_data():
    """fertility, geo data, labor, population y predictions """
    try:
        response = supabase.from_("LabourForecast").execute()
        if response.error:
            st.error(f"Error fetching data: {response.error}")
            return pd.DataFrame()
        else:
            return pd.DataFrame(response.data)
    except Exception as e:
        st.error(f"An error occurred: {e}")
        return pd.DataFrame()

if __name__ == "__main__":
    european_data = load_data()
    if not european_data.empty:
        print("Successfully loaded European data:")
        print(european_data.head())
    else:
        print("Failed to load European data.")