Closed mjbundas closed 6 years ago
if I run it in my Spyder IDE(3.6) it runs the code fine and pulls the data, but will not display the maps
I don't know very much about Spyder, but unless it explicitly supports Jupyter widgets, that's expected behaviour.
Regarding not downloading the earthquake data -- that's pretty strange. What version of Python are you using (import sys; sys.version
)? When you were working with Spyder, was it also on Windows?
Ah -- this looks like it might be related:
I was working with spyder 3.6.1 and I actually got it to output the graphs I just had to use an export into html to make a graph file. A little detour, but it gets the job done for now. I have a feeling the jupyter issue has to do with some firewalls that I'm dealing with at work. This is a work project that I will be using this for.
from ipywidgets.embed import embed_minimal_html embed_minimal_html('exportfig.html', views = [fig])
Very Respectfully, Michael Bundas
On Sat, Apr 21, 2018 at 3:15 AM, Pascal Bugnion notifications@github.com wrote:
if I run it in my Spyder IDE(3.6) it runs the code fine and pulls the data, but will not display the maps
I don't know very much about Spyder, but unless it explicitly supports Jupyter widgets, that's expected behaviour.
Regarding not downloading the earthquake data -- that's pretty strange. What version of Python are you using (import sys; sys.version)? When you were working with Spyder, was it also on Windows?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pbugnion/gmaps/issues/245#issuecomment-383274006, or mute the thread https://github.com/notifications/unsubscribe-auth/AkxnzqmzPa0MBZ49djAIIdDoGfDdrZnOks5tqtypgaJpZM4Tdd1n .
Glad that works -- it may have to do with firewalls, but I suspect the request isn't even being dispatched. I expect that it's to do with how Python is installed.
To verify whether you have HTTPS support, you can try:
import urllib
urllib.urlopen('https://google.com').read()
If that returns an HTML document, everything's good.
As a separate workaround, I think you only need https support to use gmaps.datasets
and gmaps.geometries
. If you aren't using these modules, the rest of the code should (?) work fine. If you do want to use gmaps.datasets
, I suggest just downloading CSVs on your Spyder installation, saving these to a file, and then loading from that file when you're at work, instead of fetching them from the internet.
The gmaps.datasets.load_dataset_as_df
method just returns a Pandas dataframe, so you should be able to save the resultant object to a CSV like:
earthquakes = gmaps.datasets.load_dataset_as_df('earthquakes')
earthquakes.to_csv('earthquakes.csv', index=False)
You can then read back from that with:
import pandas as pd
pd.read_csv('earthquakes.csv')
Thanks for all the help! I'll give these a try. I really appreciate it.
Very Respectfully, Michael Bundas
On Tue, Apr 24, 2018 at 1:37 AM, Pascal Bugnion notifications@github.com wrote:
Glad that works -- it may have to do with firewalls, but I suspect the request isn't even being dispatched. I expect that it's to do with how Python is installed.
To verify whether you have HTTPS support, you can try:
import urllib urllib.urlopen('https://google.com').read()
If that returns an HTML document, everything's good.
As a separate workaround, I think you only need https support to use gmaps.datasets and gmaps.geometries. If you aren't using these modules, the rest of the code should (?) work fine. If you do want to use gmaps.datasets, I suggest just downloading CSVs on your Spyder installation, saving these to a file, and then loading from that file when you're at work, instead of fetching them from the internet.
The gmaps.datasets.load_dataset_as_df method just returns a Pandas dataframe, so you should be able to save the resultant object to a CSV like:
earthquakes = gmaps.datasets.load_dataset_as_df('earthquakes') earthquakes.to_csv('earthquakes.csv', index=False)
You can then read back from that with:
import pandas as pd pd.read_csv('earthquakes.csv')
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pbugnion/gmaps/issues/245#issuecomment-383809437, or mute the thread https://github.com/notifications/unsubscribe-auth/AkxnzvEYgZ_PXkA9PSW2n9jYctAGoMooks5trro1gaJpZM4Tdd1n .
I am trying to run the basic earthquake data and I keep getting this error. I copy/pasted the same dataset data and for some reason it's giving me this. There's a lot of other error text along with it, but this is the final error message. What's weird is if I run it in my Spyder IDE(3.6) it runs the code fine and pulls the data, but will not display the maps. Like wise if I just run gmaps.figure() it will display the map. Here is the code: import gmaps import gmaps.datasets
gmaps.configure(api_key='AI...') # Fill in with your API key( Mine is filled in with my key)
earthquake_df = gmaps.datasets.load_dataset_as_df('earthquakes') This is the line that's causing the error message
earthquake_df.head()