So I have some data
import pyfits
import matplotlib.pyplot
a = pyfits.getdata('data.fits')
x = a['time']
y = a['flux']
I had a issue with some data where my arrays contained NaN values. To get rid of them, I did the following:
x = x[numpy.logical_not(numpy.isnan(x))]
y = y[numpy.logical_not(numpy.isnan(y))]
Which removes all NaN values from the arrays x and y. The problem is that x and y did not contain the same amount of NaN values.
so:
len(y) = 4275
whereas:
len(x) = 4313
I’d like to be able to do this:
pyplot.plot(x,y)
but there is a problem with trying to plot arrays of different dimensions. Is there a way that I can do this?
How are you getting your data plots? I would assume on import you would have x or y be 0 such that each x has an appropriate y?