Hola, pueden ayudarme con este problema en el momento de crear el banco en memoria:
from sqlalchemy import create_engine, MetaData, Table
engine = create_engine('sqlite:///:memory:') matriculas_por_curso.to_sql('matriculas', engine) print(engine.table_names())
y el print genera el siguiente error:
AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 print(engine.table_names())
AttributeError: 'Engine' object has no attribute 'table_names'
además, he intentado buscar en el banco:
query = ''select * from matriculas where total < 20''
pd.read_sql(query, engine), este codigo genera el error:
AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 pd.read_sql(query, engine)
2 frames /usr/local/lib/python3.10/dist-packages/pandas/io/sql.py in execute(self, *args, **kwargs) 1403 def execute(self, *args, **kwargs): 1404 """Simple passthrough to SQLAlchemy connectable""" -> 1405 return self.connectable.execution_options().execute(*args, **kwargs) 1406 1407 def read_table(
AttributeError: 'OptionEngine' object has no attribute 'execute'