internal void CBind(DF df) { for (int i = 1; i <= df.NCol; i++) { this.AddColumn(df.GetColumn(i)); } }
internal static DF AddRow(DF df1, List <double> row) { DF dfRes = df1.Clone(); dfRes.AddRow(row); return(dfRes); }
internal static DF AddRow(DF df, AR ts) { List <double> row = ts.ToList(); DF dfRes = AddRow(df, row); return(dfRes); }
internal static DF AddColumn(DF df, List <double> col) { DF dfRes = df.Clone(); dfRes.AddColumn(col); return(dfRes); }
internal void RBind(DF df) { for (int i = 1; i <= df.NRow; i++) { List <double> row = df.GetRow(i); this.AddRow(row); } }
internal static DF AddColumn(DF df, AR ts) { List <double> col = ts.ToList(); DF dfRes = df.Clone(); dfRes.AddColumn(col); return(dfRes); }
internal DF SubDfRows(int[] sel) { DF dfRes = new DF(this.NCol); for (int i = 0; i < sel.Length; i++) { dfRes.AddRow(this.GetRow(sel[i])); } return(dfRes); }
internal DF SubDfRows(int ini, int end) { DF dfRes = new DF(this.NCol); for (int i = ini; i <= end; i++) { dfRes.AddRow(this.GetRow(i)); } return(dfRes); }
internal DF SubDfCols(int[] sel) { DF dfRes = new DF(); for (int i = 0; i < sel.Length; i++) { dfRes.AddColumn(this.GetColumn(sel[i])); } return(dfRes); }
internal DF SubDfCols(int ini, int end) { DF dfRes = new DF(); for (int i = ini; i <= end; i++) { dfRes.AddColumn(this.GetColumn(i)); } return(dfRes); }
internal static DF CBind(DF df1, DF df2) { DF dfRes = df1.Clone(); for (int i = 1; i <= df2.NCol; i++) { dfRes.AddColumn(df2.GetColumn(i)); } return(dfRes); }
internal static DF RBind(DF df1, DF df2) { DF dfBind = df1.Clone(); for (int i = 1; i <= df2.NRow; i++) { List <double> row = df2.GetRow(i); dfBind.AddRow(row); } return(dfBind); }
public static DF operator /(DF df, double val) { DF dfRes = df.Clone(); for (int i = 1; i <= df.NRow; i++) { for (int j = 1; j <= df.NCol; j++) { dfRes[i, j] = df[i, j] / val; } } return(dfRes); }
internal DF(DF df) : this() { List <List <double> > dfCols = df.GetCols(); this.cols = new List <List <double> >(); for (int i = 0; i < dfCols.Count; i++) { this.cols.Add(new List <double>()); for (int j = 0; j < dfCols[i].Count; j++) { this.cols[i].Add(dfCols[i][j]); } } }
public static DF operator /(DF df1, DF df2) { if (df1.NRow != df2.NRow || df1.NCol != df2.NCol) { throw new Exception("Error. Different dimensions"); } DF dfRes = df1.Clone(); for (int i = 1; i <= dfRes.NRow; i++) { for (int j = 1; j <= dfRes.NCol; j++) { dfRes[i, j] /= df2[i, j]; } } return(dfRes); }
internal DF Clone() { DF dfClone = new DF(this); return(dfClone); }