Exemple #1
0
 internal void CBind(DF df)
 {
     for (int i = 1; i <= df.NCol; i++)
     {
         this.AddColumn(df.GetColumn(i));
     }
 }
Exemple #2
0
        internal static DF AddRow(DF df1, List <double> row)
        {
            DF dfRes = df1.Clone();

            dfRes.AddRow(row);
            return(dfRes);
        }
Exemple #3
0
        internal static DF AddRow(DF df, AR ts)
        {
            List <double> row   = ts.ToList();
            DF            dfRes = AddRow(df, row);

            return(dfRes);
        }
Exemple #4
0
        internal static DF AddColumn(DF df, List <double> col)
        {
            DF dfRes = df.Clone();

            dfRes.AddColumn(col);
            return(dfRes);
        }
Exemple #5
0
 internal void RBind(DF df)
 {
     for (int i = 1; i <= df.NRow; i++)
     {
         List <double> row = df.GetRow(i);
         this.AddRow(row);
     }
 }
Exemple #6
0
        internal static DF AddColumn(DF df, AR ts)
        {
            List <double> col   = ts.ToList();
            DF            dfRes = df.Clone();

            dfRes.AddColumn(col);
            return(dfRes);
        }
Exemple #7
0
        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);
        }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }
Exemple #10
0
        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);
        }
Exemple #11
0
        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);
        }
Exemple #12
0
        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);
        }
Exemple #13
0
        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);
        }
Exemple #14
0
        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]);
                }
            }
        }
Exemple #15
0
        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);
        }
Exemple #16
0
        internal DF Clone()
        {
            DF dfClone = new DF(this);

            return(dfClone);
        }