Beispiel #1
0
        public MultiGetterAt <MutableTuple <T1> > GetMultiGetterAt <T1>(int[] cols)
            where T1 : IEquatable <T1>, IComparable <T1>
        {
            var newCols = _columns == null ? cols : cols.Select(c => _columns[c]).ToArray();

            return(_src.GetMultiGetterAt <T1>(newCols));
        }
Beispiel #2
0
        public DataFrame TJoin <T1, T2, T3>(IDataFrameView right, IEnumerable <int> colsLeft, IEnumerable <int> colsRight, string leftSuffix = null, string rightSuffix = null, JoinStrategy joinType = JoinStrategy.Inner, bool sort = true)
            where T1 : IEquatable <T1>, IComparable <T1>
            where T2 : IEquatable <T2>, IComparable <T2>
            where T3 : IEquatable <T3>, IComparable <T3>
        {
            int[] orderLeft    = _rows.Select(c => c).ToArray();
            int[] orderRight   = (right as DataFrame) is null ? (right as DataFrameView)._rows.Select(c => c).ToArray() : null;
            int[] columnsRight = (right as DataFrame) is null ? (right as DataFrameView)._columns : null;
            var   icolsLeft    = colsLeft.ToArray();
            var   icolsRight   = colsRight.ToArray();
            var   scolsLeft    = icolsLeft.Select(c => Schema.GetColumnName(c)).ToArray();
            var   scolsRight   = icolsRight.Select(c => right.SchemaI.GetColumnName(c)).ToArray();

            return(DataFrameJoining.TJoin(this, right,
                                          orderLeft, orderRight,
                                          _columns, columnsRight,
                                          icolsLeft, icolsRight, sort,
                                          leftSuffix, rightSuffix,
                                          joinType,
                                          GetMultiGetterAt <T1, T2, T3>(icolsLeft),
                                          right.GetMultiGetterAt <T1, T2, T3>(icolsRight),
                                          ke => ke.ToImTuple(),
                                          ke => DataFrameGroupKey.Create(scolsLeft, ke),
                                          ke => DataFrameGroupKey.Create(scolsRight, ke)));
        }