<jupyter_start><jupyter_text>Importando pacotes<jupyter_code>%matplotlib inline
import pandas as pd
import numpy as np
from sqlalchemy import create_engine<jupyter_output><empty_output><jupyter_text>Criando conexão com o banco de dados _Caso tenha problemas com `encoding`, você pode passar o charset como parâmetro na conexão._```"firebird+fdb://sysdba:masterkey@firebird:3050//firebird/data/database.fdb?charset=ISO8859_1")```<jupyter_code>engine = create_engine("firebird+fdb://sysdba:masterkey@firebird:3050//firebird/data/examples.fdb")
def run_query(query):
    return pd.read_sql_query(query,con=engine)<jupyter_output><empty_output><jupyter_text>Executando query<jupyter_code>query = """
select * from CUSTOMER;
"""
df = run_query(query)
df.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1197452229299363, 'fraction_numerical': 0.016560509554140127, 'mean_word_length': 9.621621621621621, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '280949', 'license': 'Apache-2.0', 'n_tokens_mistral': 303, 'n_tokens_neox': 287, 'n_words': 47, 'path': 'Analyze firebird database.ipynb', 'repo_name': 'cilas/pandas-firebird-jupyter', 'size': '785'}