24 lines
578 B
Python
24 lines
578 B
Python
#!/usr/bin/env python3
|
|
# -*- coding:UTF-8 -*-
|
|
|
|
from sqlalchemy import create_engine #, text
|
|
from sqlalchemy.engine import URL
|
|
import pandas as pd
|
|
from pycen import con_sicen as con
|
|
|
|
|
|
sql = '''
|
|
SELECT * FROM inpn.taxons_isere_absents_taxref
|
|
WHERE cd_nom::text NOT IN (SELECT cd_nom FROM inpn.taxref)'''
|
|
taxabs = pd.read_sql_query(
|
|
sql=sql,con=con
|
|
)
|
|
taxabs.cd_ref = taxabs.cd_ref.astype(int).astype(str)
|
|
taxabs.drop(columns=['id_taxon','source'], inplace=True)
|
|
taxabs.to_sql(
|
|
name='taxref',
|
|
con=con,
|
|
schema='inpn',
|
|
if_exists='append',
|
|
index=False
|
|
) |