问题描述
什么是改变deedle框架柱秩序的最佳途径?例如,如果我有一个deedle帧东风
的列高度
,名称
和电话
,但我需要它,以名称
,电话
和高度
。
What is the best way to change column order in deedle frame? For example if I have a deedle frame df
with columns height
, Name
, and phone
, but I need it in order Name
, phone
, and height
.
推荐答案
Deedle具有的,但事实证明,我们没有 RealignColumns
。这是一个疏忽,如果你发送一个公关Deedle添加此,这将是真棒!
Deedle has RealignRows
extension method, but it turns out that we don't have RealignColumns
. This is an omission and if you send a PR to Deedle adding this, that would be awesome!
它可以通过查看该系列列,重新调整列实施并把该回的数据帧。在C#中,这看起来如下:
It can be implemented by looking at the series of columns, realigning the columns and turning that back into a data frame. In C#, this looks as follows:
Frame.FromColumns(df.Columns.Realign(new[] { "key 1", "key 2" }));
这篇关于在deedle框更改列顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!