Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
F#deedle Series如何获取密钥和序列的名称以在XPlot中使用_F#_Deedle_Fslab - Fatal编程技术网

F#deedle Series如何获取密钥和序列的名称以在XPlot中使用

F#deedle Series如何获取密钥和序列的名称以在XPlot中使用,f#,deedle,fslab,F#,Deedle,Fslab,我正在用XPLot绘制一张Table类型的图表。如果未指定Chart.WithLables,则该表将使用Column1和Column2作为标题。“我的系列”是从数据帧创建的(在标题名为“日期”的列上建立索引,并且有一列标题名为“关闭”。以下是从数据帧获取系列的代码: `let closes = cl?Close` 因为我知道Chart:Table中的第一列是序列键,第二列是序列的值 // Chart type: Table of column Close closes |> Char

我正在用XPLot绘制一张Table类型的图表。如果未指定Chart.WithLables,则该表将使用Column1和Column2作为标题。“我的系列”是从数据帧创建的(在标题名为“日期”的列上建立索引,并且有一列标题名为“关闭”。以下是从数据帧获取系列的代码:

`let closes =  cl?Close`
因为我知道Chart:Table中的第一列是序列键,第二列是序列的值

// Chart type: Table of column Close 
closes
|> Chart.Table
|> Chart.WithOptions(Options(showRowNumber = true, page = "enable",    pageSize = 20)) 
|> Chart.WithLabels ["Date"; "Close"]
我正在寻找一种方法来提取键的名称(日期)和值的名称(关闭)

cl.Columns.Keys
获取列标题。我找不到任何系列的等效项。我想对图表进行编码

Chart.WithLabels [closes.KeyName; closes.Name]

与框架不同,Deedle series不存储键和值的名称

如果您想编写一个可重用函数,则需要将名称作为附加参数传递,或者您可以向函数传递一个带有单列的数据框

我可能会这样写:

let plotSeriess label data =
  data
  |> Chart.Table
  |> Chart.WithOptions(Options(showRowNumber = true, page = "enable",    pageSize = 20)) 
  |> Chart.WithLabels ["Date"; label]