2

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?

  • Do you have geometries in the dataframe or is it only a table? – BERA Jul 5 '18 at 5:16
  • It is only a table. – Yashdeep Singh Dahiya Jul 5 '18 at 5:22
  • Can you show us what your dataframe looks like? You can probably use memory layer. Just convert each line of your dataframe to feature. – YoLecomte Jan 6 at 15:54
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.