Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.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
Indexing Deedle 1.0.7帧行索引不强制执行唯一键_Indexing_F#_Duplicates_Deedle - Fatal编程技术网

Indexing Deedle 1.0.7帧行索引不强制执行唯一键

Indexing Deedle 1.0.7帧行索引不强制执行唯一键,indexing,f#,duplicates,deedle,Indexing,F#,Duplicates,Deedle,自Deedle 1.0.7发布以来,index row函数不再验证用作键的列是否包含唯一值。这种行为与评论所暗示的不同。如何确保列键只能使用唯一值 在以前的版本中,以下代码将触发错误,因为用作索引的列包含重复项。然而,在Deedle 1.0.7中,情况不再如此,代码将起作用,框架将包含一个指向记录数组的索引项。这是故意的吗 type t1 = {d:DateTime; v:double} let s1 =[{d=DateTime.Now.Date; v= 1.0}; {d=

自Deedle 1.0.7发布以来,index row函数不再验证用作键的列是否包含唯一值。这种行为与评论所暗示的不同。如何确保列键只能使用唯一值

在以前的版本中,以下代码将触发错误,因为用作索引的列包含重复项。然而,在Deedle 1.0.7中,情况不再如此,代码将起作用,框架将包含一个指向记录数组的索引项。这是故意的吗

type t1 = {d:DateTime; v:double}

let s1 =[{d=DateTime.Now.Date; v= 1.0};
          {d=DateTime.Now.Date; v= 2.0};
          {d=DateTime.Now.Date; v= 3.0};
         ]

let f1 = Frame.ofRecords s1 |> Frame.indexRowsDate "d"


 type t2 = {d:int; v:double}

 let s2 =[{d=1; v= 1.0};
          {d=1; v= 2.0};
           {d=1; v= 3.0};
         ]

 let f2 = Frame.ofRecords s2 |> Frame.indexRowsInt "d"
但是,如果我试图访问由重复键索引的序列,Deedle将给出一个错误

let cv = f2.GetColumn<double> "v"

let item = cv.Get(1)

val cv : Series<int,double> = series [ 1 => 1; 1 => 2; 1 => 3]

> 
System.ArgumentException: Duplicate key '1'. Duplicate keys are not     allowed in the index.
 Parameter name: keys
   at Deedle.Indices.Linear.LinearIndex`1.makeLookup() in     c:\Tomas\Public\Deedle\src\Deedle\Indices\LinearIndex.fs:line 53
在Deedle.index.Linear.LinearIndex1.get_lookupMap中的c:\Tomas\Public\Deedle\src\Deedle\index\LinearIndex.fs:第63行 在c:\Tomas\Public\Deedle\src\Deedle\index\LinearIndex.fs中的Deedle.index.Linear.LinearIndex1.Deedle-index-IIndex1-LocateK键:第101行 在c:\Tomas\Public\Deedle\src\Deedle\Series.fs中的Deedle.Series2.GetK键:第291行 在C:\Users\win8dev\Documents\visualstudio 2013\Projects\DeedleTake2\deedlet107\Script.fsx中的.FSI_0046.main@处:第40行 由于错误而停止

更新:

正如Tomas所建议的,Github的罚单已经提出


我认为我们应该确保钥匙在Deedle中是独一无二的。您能在GitHub上记录代码的问题吗?这样我们就可以恢复最初的预期行为?在GitHub上引发的问题。谢谢