Skip to content
Advertisement

Tag: pandas

SQL apply where clause to an arbitrary query results

I’m working on a system where the user introduces an SQL server/db connection and a valid SQL query, which I save on my system. I’m using python+sqlalchemy+pandas to accomplish this. That query will return a table like this one, in which the only rule is that the query result must have a timestamp as DateTime field and at least another

How to get column names from a SQL query?

I need to put data from the SQL query into a Pandas dataframe. Please tell me is it possible to get column names the query results? I found that there is a keys() function in sqlalchemy for that but it does not work for me: AttributeError: ‘CMySQLCursor’ object has no attribute ‘keys’ Answer I think that it your are searching

Advertisement