Comments (5)
Relevant: #68 (comment)
Basically data needs to be like: [(lat,lon),(lat,lon)]
, so an iterable of tuples.
You could transform:
array([[ nan, nan],
[ 38., 0.],
[ 45., 0.]]))
which I read as a np.array of np.arrays of size 2 (Nx2 matrix) by going:
data=[(d[0],d[1]) for d in data]
from gmaps.
@reyale
Thank you. I tried variations on your suggestion
mydata = np.genfromtxt("/home/dgd/Desktop/text.csv", delimiter=',')
data = mydata
data =[(d[0],d[1]) for d in data]
heatmap_layer = gmaps.Heatmap(data=data)
m.add_layer(heatmap_layer)
m
but got
InvalidPointException: (nan, nan) is not a valid latitude, longitude pair
I'm grateful for any other tips you might have to resolve my goal with gmaps.
thank you
Dennis
from gmaps.
Dennis,
My guess is that you have a blank or invalid float value in your csv, and that np.genfromtxt fills these values with np.nan. Please verify all data is not nan.
You might try:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html
missing_values : variable, optional
The set of strings corresponding to missing data.
filling_values : variable, optional
The set of values to be used as default when the data are missing.
in np.genfromtxt
to automatically fill these values with valid floats.
from gmaps.
@pleabargain If you can attach the CSV to the issue (or any subset of the CSV that causes the error), we may be able to give more targeted answers.
If you do have nan
values in your data, you will have to remove these as a pre-processing step beforehand.
PRs for improved error handling always welcome!
from gmaps.
Closing as likely not a problem in gmaps directly. That said, we should improve the way we notify the user that their data is invalid.
from gmaps.
Related Issues (20)
- fig.add_layer is not working HOT 1
- extension enabled but no yaml file to tell us how to configure it
- externals in webpack.config.js causes jupyterlab widgets to fail
- Gmaps not working in python. HOT 1
- Support new JupyterLab 3.0 python based packaging HOT 1
- Cannot display map in JupyterLab HOT 1
- Directions layer not showing via `embed_minimal_html` HOT 1
- API change for collections in Python 3.3+ breaks is_atomic in options.py HOT 5
- AttributeError: module 'collections' has no attribute 'Iterable' HOT 1
- How to export a dynamic map to png without having to use a browser?
- jupyter nbextension enable --py gmaps doesn't work
- Possible bug in gmaps or ipywidgets.embed.embed_minimal_html
- Trouble when installing
- jupyter-gmaps loaded but cannot be instantiated HOT 7
- nose seems to be dead
- Cannot Install gmaps on Linux using Miniconda
- access raw traffic data
- module 'gmaps' has no attribute 'symbol' HOT 1
- No version of module jupyter-gmaps is registered HOT 1
- The gmaps package on Voila got an error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmaps.