I think your code is trying to “divide by zero” or “divide by NaN”. If you are aware of that and don’t want it to bother you, then you can try:
import numpy as np np.seterr(divide='ignore', invalid='ignore')
For more details see:
Related Posts:
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- Change figure size and figure format in matplotlib
- Purpose of “%matplotlib inline”
- Purpose of “%matplotlib inline”
- Cannot find module cv2 when using OpenCV
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- matplotlib savefig() plots different from show()
- WinError 2 The system cannot find the file specified (Python)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- TypeError: cannot perform reduce with flexible type
- Could not find a version that satisfies the requirement tensorflow
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- Local variable referenced before assignment?
- ImportError: numpy.core.multiarray failed to import
- No handles with labels found to put in legend
- How to plot a histogram using Matplotlib in Python with a list of data?
- Python Traceback (most recent call last)
- How can I plot a confusion matrix? [duplicate]
- How to pip or easy_install tkinter on Windows
- matplotlib error – no module named tkinter
- ImportError: numpy.core.multiarray failed to import
- How to remove \xa0 from string in Python?
- What is the meaning of [:] in python [duplicate]
- pandas DataFrame “no numeric data to plot” error
- Permission denied error by installing matplotlib
- Why are Python’s ‘private’ methods not actually private?
- Updating matplotlib in virtualenv with pip
- Remove list from list in Python
- How do you change the size of figures drawn with Matplotlib?
- Matplotlib automatic legend outside plot
- Add Legend to Seaborn point plot
- How do I install the yaml package for Python?
- matplotlib error – no module named tkinter
- TypeError: ‘DataFrame’ object is not callable
- Improve subplot size/spacing with many subplots in matplotlib
- How do I plot only a table in Matplotlib?
- how does \r (carriage return) work in Python
- What is Python buffer type for?
- Python equivalent to ‘hold on’ in Matlab
- Add list to set?
- Overcome ValueError for empty array
- Create 3D array using Python
- Create own colormap using matplotlib and plot color scale
- Why matplotlib does not plot?
- Checking whether pip is installed?
- Decoding UTF-8 strings in Python
- How can I read pdf in python?
- How to have an array of arrays in Python
- reducing number of plot ticks
- How to increase plt.title font size?
- Plot a horizontal line using matplotlib
- How to add title to seaborn boxplot
- Python Error – int object has no attribute
- Difference between scikit-learn and sklearn
- ValueError: x and y must be the same size
- Loading a file with more than one line of JSON into Pandas
- ValueError: Unknown projection ‘3d’ (once again)
- How to detect key presses?
- How to change plot background color?
- How to XOR two strings in Python
- Linear regression with matplotlib / numpy
- How to save a Seaborn plot into a file
- TypeError: ‘_io.TextIOWrapper’ object is not subscriptable
- Scatter plot colorbar – Matplotlib
- matplotlib: how to draw a rectangle on image
- bbox_to_anchor and loc in matplotlib
- matplotlib: RuntimeError: Python is not installed as a framework
- Python 101: Can’t open file: No such file or directory
- Python, Matplotlib, subplot: How to set the axis range?
- Split a python list into other “sublists” i.e smaller lists
- TypeError: argument of type ‘NoneType’ is not iterable
- RuntimeError: Invalid DISPLAY variable
- If list index exists, do X
- When I use matplotlib in jupyter notebook,it always raise ” matplotlib is currently using a non-GUI backend” error?
- Seaborn Lineplot Module Object Has No Attribute ‘Lineplot’
- IndexError: index 2 is out of bounds for axis 0 with size 2
- Installation of pygame with Anaconda
- Label axes on Seaborn Barplot
- ImportError: cannot import name NUMPY_MKL
- matplotlib: plot multiple columns of pandas data frame on the bar chart
- Python: Pandas pd.read_excel giving ImportError: Install xlrd >= 0.9.0 for Excel support
- How can I copy a Python string?
- Superscript in Python plots
- Convert string to variable name in python
- IPython, “name ‘plt’ not defined”
- What is the meaning of “int(a[::-1])” in Python?
- Pandas dataframe groupby plot
- dump() missing 1 required positional argument: ‘fp’ in python json
- How to completely uninstall python 2.7.13 on Ubuntu 16.04
- Spell Checker for Python
- How to plot normal distribution
- Installing scipy for python 2.7
- How can I install a .egg Python package on Windows (attempt using easy_install not working)
- How do I tell Matplotlib to create a second (new) plot, then later plot on the old one?
- Installing Pylab/Matplotlib
- Cannot remove entries from nonexistent file
- TypeError: zip argument #2 must support iteration
- numpy/scipy/ipython:Failed to interpret file as a pickle