OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Handling Infinite Values in Seaborn

  • Thread starter Thread starter José Antonio Pino Morales
  • Start date Start date
J

José Antonio Pino Morales

Guest
I'm trying to plot a pairplot of my dataset using Seaborn, but I'm encountering an error related to infinite values. Here is the code I'm using:

Code:
import seaborn as sns
import matplotlib.pyplot as plt

sns.pairplot(df_train[cols], height=2.5)
plt.show()

However, I get the following warning:

Code:
C:\Users\jpino\anaconda3\Lib\site-packages\seaborn_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):

How can I handle the infinite values in my dataset to avoid this warning and successfully plot the pairplot?
<p>I'm trying to plot a <code>pairplot</code> of my dataset using Seaborn, but I'm encountering an error related to infinite values. Here is the code I'm using:</p>
<pre class="lang-py prettyprint-override"><code>import seaborn as sns
import matplotlib.pyplot as plt

sns.pairplot(df_train[cols], height=2.5)
plt.show()
</code></pre>
<p>However, I get the following warning:</p>
<pre class="lang-py prettyprint-override"><code>C:\Users\jpino\anaconda3\Lib\site-packages\seaborn_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
</code></pre>
<p>How can I handle the infinite values in my dataset to avoid this warning and successfully plot the pairplot?</p>
 
Top