How to import csv data file into scikit-learn?

后端 未结 4 1840
轮回少年
轮回少年 2021-01-30 03:16

From my understanding, the scikit-learn accepts data in (n-sample, n-feature) format which is a 2D array. Assuming I have data in the form ...

Stock prices    in         


        
4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 03:43

    You can look up the loadtxt function in numpy.

    To get the optional inputs into the loadtxt method.

    A simple change for csv is

    data =  np.loadtxt(fname = f, delimiter = ',')
    

提交回复
热议问题