Dataframe 如何在FSI中将Deedle数据帧显示为一个漂亮的表?
阅读文章《用F#()分析和可视化数据》(可能是错误的)时,我发现人们可以在Dataframe 如何在FSI中将Deedle数据帧显示为一个漂亮的表?,dataframe,f#,deedle,fsi,Dataframe,F#,Deedle,Fsi,阅读文章《用F#()分析和可视化数据》(可能是错误的)时,我发现人们可以在FSharp Interactive(FSI)中将Deedle数据框的内容显示为一个漂亮的表格 让我这么想的文本片段如下: When you create a data frame, F# Interactive formats it nicely so you can get a quick idea about the data. For example, in Table 2-1 you can see the ra
FSharp Interactive
(FSI
)中将Deedle数据框的内容显示为一个漂亮的表格
让我这么想的文本片段如下:
When you create a data frame, F# Interactive formats it nicely so you can get a quick idea about the data. For example, in Table 2-1 you can see the ranges of the values and which values are frequently missing.
这些行前面有一个漂亮的表,显示了数据帧的内容
如果不安装和打开FSLab
,如本文所建议,当我可以在FSI
中创建DataFrame
,然后输入其名称和“;”时,我会得到如下结果:
> df;;
val it : Frame<int,string> =
Deedle.Frame`2[System.Int32,System.String]
{ColumnCount = 2;
ColumnIndex = Deedle.Indices.Linear.LinearIndex`1[System.String];
ColumnKeys = seq ["A"; "B"];
ColumnTypes = seq [System.Int32; System.Int32];
Columns = series [ A => series [ 0 => 1; 1 => 2; 2 => 3; 3 => 4; 4 => 5; ... ; 9 => 10]; B => series [ 0 => 11; 1 => 12; 2 => 13; 3 => 14; 4 => 15; ... ; 9 => 20]];
ColumnsDense = series [ A => series [ 0 => 1; 1 => 2; 2 => 3; 3 => 4; 4 => 5; ... ; 9 => 10]; B => series [ 0 => 11; 1 => 12; 2 => 13; 3 => 14; 4 => 15; ... ; 9 => 20]];
IsEmpty = false;
Item = ?;
Item = ?;
RowCount = 10;
RowIndex = Deedle.Indices.Linear.LinearIndex`1[System.Int32];
RowKeys = seq [0; 1; 2; 3; ...];
Rows = series [ 0 => series [ A => 1; B => 11]; 1 => series [ A => 2; B => 12]; 2 => series [ A => 3; B => 13]; 3 => series [ A => 4; B => 14]; 4 => series [ A => 5; B => 15]; ... ; 9 => series [ A => 10; B => 20]];
RowsDense = series [ 0 => series [ A => 1; B => 11]; 1 => series [ A => 2; B => 12]; 2 => series [ A => 3; B => 13]; 3 => series [ A => 4; B => 14]; 4 => series [ A => 5; B => 15]; ... ; 9 => series [ A => 10; B => 20]];}
我怀疑这个问题有一个简单的解决办法
所以
1) 我真的可以在FSI
中得到一个很好的表来显示Deedle数据帧的内容吗(就像人们在RStudio
中为R
所做的那样)
2) 如果是,我应该怎么做才能在不向后移动我安装的软件包版本的情况下可视化这些表?如果您使用软件包中包含的Deedle.fsx
加载脚本引用Deedle,则F#Interactive打印机将自动注册:
#load "packages/Deedle/Deedle.fsx"
open Deedle
let df =
[ "First" => Series.ofValues [1;2;3;4]
"Second" => Series.ofValues [1;2;3;4] ]
|> frame
如果您使用Paket引用Deedle并运行上述代码,您将得到很好的打印输出。或者,您也可以通过显式调用来获得相同的输出:
df.Print()
正是我需要的。Thx.FWIWdf.Print()
也适用于控制台应用程序。
df.Print()