我正在尝试FsLab和CvsProvider。下面的脚本在f#REPL中有效,但是,我对ckv文件的列名没有任何智能理解,例如在下面的示例中,“日期”和“打开”。因此,MSVS还将那些标记为未定义的字段,构造函数或成员。
我安装了带有包/ nuget的FsLab 1.1.6。
有什么想法可以像那里的任何教学视频一样获得它吗?
关于WP
#load "packages/FsLab/FsLab.fsx"
#load ".paket/load/net452/FSharp.Data.fsx"
open FSharp.Data
type Stocks = CsvProvider<"../../MSFT.csv">
//let msft = Stocks.Load("../../MSFT.csv")
let msft = CsvProvider<"../../MSFT.csv">.GetSample()
// Look at the most recent row. Note the 'Date' property
// is of type 'DateTime' and 'Open' has a type 'decimal'
let firstRow = msft.Rows |> Seq.head
let lastDate = firstRow.Date
let lastOpen = firstRow.Open
// Print the prices in the HLOC format
for row in msft.Rows do
printfn "HLOC: (%A, %A, %A, %A)" row.High row.Low row.Open row.Close