Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2018 07:11 AM
I see the way to move from
python to sql is to create a temp view, and then access that dataframe from sql, and in a sql cell.
Now the question is, how can I have a
%sql cell with a select statement in it, and assign the result of that statement to a dataframe variable which I can then use in the next python cell?
EDIT: I'm aware that I can run a SQL query in python and store the result in a dataframe. But what happens in reality is that I develop the SQL code in a
%sql cell, and once it works I have to cut and paste the query back into a python cell and put it in quotes and loose the highlighting and all. This happens very frequently when I'm doing some data analysis where most of my code involves some SQL queries.
To me, it makes sense to add an option to the
select statement such as into dataframe_name, which would then register that dataframe in the python space, without actually running the query.