question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supress Warnings in library

See original GitHub issue

Thanks for a great library. please suppress the warnings below.

Example :

sns.pairplot(df_centroids, hue="CUST_ID_NEW",palette="bright", height=2, aspect=1)

seaborn version : 0.11.1 matplotlib:3.2.2

/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)
/usr/local/lib/python3.7/dist-packages/seaborn/distributions.py:306: UserWarning: Dataset has 0 variance; skipping density estimate.
  warnings.warn(msg, UserWarning)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
Haoping-Xiaocommented, Apr 26, 2021

No. I misunderstood the diagonal images. Actually, what I need is one distribution. In the example image from documentation, it has 3 classes and thus it is able to plot three distributions. But since I have a unique ‘t’, what I need is one distribution.

I sincerely appreciate your answer. And the code above refreshes my mind on how to draw a pair plot. Good to know that users can further modify the plot.

2reactions
lingpricommented, Mar 10, 2021

Your issue does not provide any other context about what you are doing, but if you have mostly single observations for each level of your hue variable, you may want to add diag_kws={"hue": None, "color": ".2"} so that the diagonal plot are not broken down by hue.

setting_the_diaganol

adding the attribute of diag_kws={"hue": None, "color": ".2"} does make the warnings disappear.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to suppress warning messages when loading a library?
These are not messages but warnings. You can do: suppressWarnings(library(RODBC)). or suppressWarnings(suppressMessages(library(RODBC))).
Read more >
Suppress compiler warnings - Visual Studio - Microsoft Learn
In Solution Explorer, choose the project or source file in which you want to suppress warnings. On the menu bar, choose View >...
Read more >
How to disable Messages when Loading a Package in R
This method is used to suppress package startup messages. The package should be pre-installed in R, otherwise, a warning is displayed upon ...
Read more >
warnings — Warning control — Python 3.11.1 documentation
The warnings filter controls whether warnings are ignored, displayed, or turned into errors (raising an exception). Conceptually, the warnings filter maintains ...
Read more >
Suppress package startup messages - Reprex - Tidyverse
To suppress warnings about conflicts, set the warn.conflicts argument of library() to FALSE . library(dplyr, warn ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found