QGIS – Importing Pandas Dataframe as Layer in QGIS

csvpandaspyqgisqgis

I'm working on a dataset that is readily available as a pandas dataframe object. Now, I would like to import this data as a layer in QGIS. I didn't find any helpful library or code to do so. So, I resorted to converting the dataframe to a csv file and then importing this as a layer using PyQGIS api.

Is there any way I can import the dataframe directly, without having to write it to a shapefile or a csv file?

Best Answer

Dataframe is in-memory object that lives inside your Jupyter Notebook (or other development tool) and QGIS reads from file. There is no simple way to move objects between different processes.