ValueError:无法将字符串转换为浮点:'A'情节

问题描述

我遇到一个情节问题。我收到错误消息:

ValueError:无法将字符串转换为浮点数:“ A”

并且我定位的列的评级为A,B,C,D,E,F,G。

我希望该行看起来像图像中附加的那一行。

def plot_woe(df_woe,r_x_axis = 0):
    x = np.array(df_woe.iloc[:,0].astype(str))
    y =df_woe['woe']
    plt.figure(figsize = (18,6))
    plt.plot(x,y,marker = 'o',linestyle = '--',color = 'k')
    plt.xlabel(df_woe.columns[0])
    plt.ylabel('Weight of Evidence')
    plt.title(str('Weight of Evidence by '+ df_woe.columns[0]))
    plt.xticks(rotation = r_x_axis)

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)