Exemplo n.º 1
0
        public static BooleanArray Compare(Series series, object value, Func <object, object, bool> comparer)
        {
            BooleanArray result = new BooleanArray(series.Count);

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = comparer(series.data[i], value);
            }
            return(result);
        }
Exemplo n.º 2
0
        public static BooleanArray operator !=(Series series, object value)
        {
            BooleanArray result = new BooleanArray(series.Count);

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = !object.Equals(series.data[i], value);
            }
            return(result);
        }
Exemplo n.º 3
0
        public static BooleanArray operator !(BooleanArray array)
        {
            var result = new BooleanArray(array.Length);

            for (int i = 0; i < result.array.Length; i++)
            {
                result.array[i] = !array.array[i];
            }
            return(result);
        }
Exemplo n.º 4
0
 public static BooleanArray operator |(BooleanArray arrayA, BooleanArray arrayB)
 {
     if (arrayA.Length == arrayB.Length)
     {
         var result = new BooleanArray(arrayA.Length);
         for (int i = 0; i < result.array.Length; i++)
         {
             result.array[i] = arrayA.array[i] | arrayB.array[i];
         }
         return(result);
     }
     else
     {
         throw new ArgumentOutOfRangeException("arrayB");
     }
 }
Exemplo n.º 5
0
 public DataFrame this [BooleanArray booleanArray]
 {
     get
     {
         if (this.rowCount == booleanArray.Length)
         {
             DataFrame newFrame = this.Clone();
             for (int i = 0; i < this.rowCount; i++)
             {
                 if (booleanArray[i])
                 {
                     DataFrameRow row = this.rows[i];
                     newFrame.ImportRowUnchecked(row);
                 }
             }
             return(newFrame);
         }
         else
         {
             throw new ArgumentOutOfRangeException("booleanArray");
         }
     }
 }