import matplotlib.pyplot as xy
a= [1,3,5,3,'',4]
b=[1,2,3,4,5,6]
xy.plot(b,a)
xy.show()
This code is throwing an error saying "ValueError: could not convert string to float:"
Create 2 new lists, that only contain valid data, which is then used for plotting. The example below skips this copying step and assumes that data from a and b can be deleted without causing any issues. If in doubt, just create a copy of both before doing the for-loop.
a=[1,3,5,3,'',4]
b=[1,2,3,4,5,6]
for index in range(len(a)-1):
if a[index] is '':
del a[index]
del b[index]
np.nan, not''