NaNs with interactive plot
See original GitHub issueI would like to visualize a single dataframe column / series of floats with no NaNs using interactive plotting, but the plot shows overlapping NaN values (screenshot). I am using the latest build off the master branch. And here is my code:
# cluster subset is the dataframe with no NaNs
umap.plot.output_notebook()
mapper = umap.UMAP().fit(cluster_subset)
p = umap.plot.interactive(mapper, hover_data=cluster_subset, point_size=3, theme='blue')
I am showing this in streamlit but the same thing happens in a jupyter notebook. Let me know if you have any idea what I’m doing wrong!
Thanks so much, Scott
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to deal with NaN values while plotting a boxplot using ...
To deal with NaN value while plotting a boxplot using Python, we can take the following steps −. Steps. Set the figure size...
Read more >Plotting masked and NaN values - Matplotlib
Sometimes you need to plot data with missing values. One possibility is to simply remove undesired data points. The line plotted through the...
Read more >Interactive Plots - The Examples Book
It allows the user to make interactive plots, which includes but is not limited to maps, ... #drops the columns that have NaN...
Read more >ScottPlot, NaN, and Infinity
The OnNaN = Gap behavior treats NaN values as a line break, simulating the appearance of gaps in the data. var plt =...
Read more >How to DO NOT fill area under NaN in plotly - Stack Overflow
How to use Plotly in offline mode? 0 · plot_ly() and shiny: change transparency of area fill in interactive environment · 5 ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This morning I had a bunch of NaNs in my hover data despite no NaNs in the training frame. In my case it was because I had a mismatch between the indices I was providing to the ‘subset’ argument and the indices of the actual dataframe. Mine was due to selecting a subset of rows (df[df[‘some_column’] == ‘asdf’] eg idx values 3,4,9,11,12,13,15), doing a fit on those, and then accidentally providing linear, sequential numbers to subset (0,1,2,3,4). To fix I copied the DF and did a reset_index() and it fixed everything.
This will be because some points are ending up completely disconnected from everything. The key thing to check is the metric and possibly setting
disconnection_distance
to something on the case of using cosine, hellinger, jaccard, or other bounded metrics.