コード例 #1
0
        /// <summary>
        /// Performs an element-wise equals on each column
        /// </summary>
        public DataFrame ElementwiseEquals <T>(T value)
            where T : unmanaged
        {
            DataFrame retDataFrame = new DataFrame();

            for (int i = 0; i < Columns.Count; i++)
            {
                DataFrameColumn baseColumn = _columnCollection[i];
                DataFrameColumn newColumn  = baseColumn.ElementwiseEquals(value);
                retDataFrame.Columns.Insert(i, newColumn);
            }
            return(retDataFrame);
        }
コード例 #2
0
        public DataFrame ElementwiseEquals <T>(IReadOnlyList <T> values)
            where T : unmanaged
        {
            if (values.Count != Columns.Count)
            {
                throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values));
            }
            DataFrame retDataFrame = new DataFrame();

            for (int i = 0; i < Columns.Count; i++)
            {
                DataFrameColumn baseColumn = _columnCollection[i];
                DataFrameColumn newColumn  = baseColumn.ElementwiseEquals(values[i]);
                retDataFrame.Columns.Insert(i, newColumn);
            }
            return(retDataFrame);
        }