I am writing a python script for QGIS.
I have a pandas dataframe that I would like to use in order to create a QgsVectorLayer.
At the moment I am saving the data frame into a .csv and then I load it:
name_csv = 'virtuali.csv'
df.to_csv(name_csv,index=False)
path = "file:///" + name_csv + "?encoding=%s&delimiter=%s&xField=%s&yField=%s&crs=%s" % ("UTF-8",",", "Longitudine", "Latitudine","epsg:4326")
mylayer = QgsVectorLayer(path, "pandas_layer", "delimitedtext")
Is there a way to create the Pandas dataframe directly without saving and reloading it?