ValueError: could not convert string to float: '"-0.33'と出てしまう


ValueError: could not convert string to float: '"-0.33'と出てしまいます  
データはしたの写真です

[ブロック引用](https://wsdmoodle.waseda.jp/pluginfile.php/1550422/question/questiontext/5154458/1/15127316/polyreg.csv)

[code]

    import numpy as np
    from sklearn. linear_model import LinearRegression
    arr2d_data = np.loadtxt(fname="/Users/ryotakumazawa/Desktop/]]]lp;:.........../polyreg.csv", delimiter=",")
    array_x = arr2d_data[:, 0]
    array_y = arr2d_data[:, 1]
    list2d_X = []
    for x in array_x:
        list2d_X+=[[x,x**2,x**3]]
    arr2d_X= np.array(list2d_X)
    reg = LinearRegression()
    reg.fit(arr2d_X, array_y)
    print('[0:.2f]'.format(reg.coef_[0]))
    print('[O:.2f]'.format(reg.coef_[1]))
    print('[0:.2f]'.format(reg.coef_[2]))
    print('[0:.2f]'.format(reg.intercept_))
    
[/code]




`f-strings` と `round()` 関数を使用できます。

[code]

    print(f"{round(reg.coef_[0],2)}")
    print(f"{round(reg.coef_[1],2)}")
    print(f"{round(reg.coef_[2],2)}")
    print(f"{round(reg.intercept_,2)}")
    
[/code]

