0
FrameExtensions似乎僅支持通過單列進行排序。 OrderBy有一個「.ThenBy」選項,但似乎已被棄用。任何其他方式排序「日期」,然後通過「RECN」?C#Deedle按多列進行排序
代碼:
using System;
using Deedle;
namespace test
{
class MainClass
{
public static void Main (string[] args)
{
var df1 = Frame.ReadCsv (@"../../test.csv");
Console.WriteLine(df1.GetType());
df1.Print();
FrameExtensions.SortRows (df1, "DATE").Print();
}
}
}
這不起作用,或者:
df1.GroupRowsBy<int> ("RECN").GroupRowsBy<DateTime> ("DATE").Print();
df1.GroupRowsBy<DateTime> ("DATE").GroupRowsBy<int> ("RECN").Print();
數據:
NAME,TYPE,DATE,RECN,COMM
Kermit,Frog,06/30/14,1,1test
Kermit,Frog,06/30/14,1,2test
Ms. Piggy,Pig,07/01/14,2,1test
Fozzy,Bear,06/29/14,3,1test
Kermit,Frog,07/02/14,1,3test
Kermit,Frog,07/02/14,1,4test
Kermit,Frog,07/02/14,1,5test
Ms. Piggy,Pig,07/02/14,2,3test
Fozzy,Bear,07/02/14,3,2test
Ms. Piggy,Pig,07/02/14,2,2test
呵呵。這似乎不符合FrameExtensions.SortRows的指定語法,但它似乎工作:FrameExtensions.SortRows(df1,「RECN」)。SortRows(「DATE」)。Print(); – user3478193