I am facing an issue while plotting contour chart in python as it gives an error message "Value error: could not convert string to float: 03Dec2063". I have data in Excel as per below format.
FinalMaturity | Tenor | Breach
04Jan2021 | 12 | 1.56
04Jan2021 | 12 | 1.74
02Dec2021 | 24 | 1.43
02Dec2021 | 24 | 1.26
......... | .. | ....
03Dec2063 | 48 | 1.18
It's very strange that error talks about only last line date. I attach my code here.
Thanks,
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
path = r'C:\desktop\users\abc.xlsx'
data = pd.read_excel(path)
X,Y = np.meshgrid(data['FinalMaturity'],data['Tenor'])
plt.contourf(X,Y,np.average(data['Breach']))