239 references to Rows
Microsoft.Data.Analysis (40)
DataFrame.Arrow.cs (2)
189int numberOfRowsInThisRecordBatch = (int)Math.Min(recordBatchLength, Rows.Count); 207} while (numberOfRowsProcessed < Rows.Count);
DataFrame.cs (13)
181for (long i = Rows.Count - numberOfRows; i < Rows.Count; i++) 183filter[i - (Rows.Count - numberOfRows)] = i; 337if (numberOfRows > Rows.Count) 339throw new ArgumentException(string.Format(Strings.ExceedsNumberOfRows, Rows.Count), nameof(numberOfRows)); 343int shuffleUpperLimit = (int)Math.Min(Int32.MaxValue, Rows.Count); 418filter.AppendMany(true, Rows.Count); 438filter.AppendMany(false, Rows.Count); 661if (column.Length == Rows.Count) 721long numberOfRows = Math.Min(Rows.Count, rowsToShow); 724foreach (object obj in Rows[i]) 731if (numberOfRows < Rows.Count) 733sb.Append(String.Format(Strings.AmountOfRowsShown, rowsToShow, Rows.Count));
DataFrame.IDataView.cs (2)
41long? IDataView.GetRowCount() => Rows.Count; 137return _position < _dataFrame.Rows.Count;
DataFrame.IO.cs (2)
165foreach (var row in Rows) 682foreach (var row in dataFrame.Rows)
DataFrame.Join.cs (20)
57long minLength = Math.Min(Rows.Count, other.Rows.Count); 66if (other.Rows.Count < Rows.Count) 68newColumn = other.Columns[i].Clone(numberOfNullsToAppend: Rows.Count - other.Rows.Count); 80long minLength = Math.Min(Rows.Count, other.Rows.Count); 89if (Rows.Count < other.Rows.Count) 91newColumn = Columns[i].Clone(numberOfNullsToAppend: other.Rows.Count - Rows.Count); 108long newRowCount = Math.Max(Rows.Count, other.Rows.Count); 109long numberOfNulls = newRowCount - Rows.Count; 115numberOfNulls = newRowCount - other.Rows.Count; 125long newRowCount = Math.Min(Rows.Count, other.Rows.Count); 360isLeftDataFrameRetained = (Rows.Count > other.Rows.Count);
GroupBy.cs (1)
503return _keyToRowIndicesMap.Select(kvp => new Grouping(kvp.Key, kvp.Value.Select(index => _dataFrame.Rows[index])));
Microsoft.Data.Analysis.Interactive (7)
DataFrameKernelExtension.cs (7)
50if (df.Rows.Count > rowsPerPage) 52var maxMessage = df.Rows.Count > maxRowCount ? $" (showing a max of {maxRowCount} rows)" : string.Empty; 53var title = h3[style: "text-align: center;"]($"DataFrame - {df.Rows.Count} rows {maxMessage}"); 56var rowCount = Math.Min(maxRowCount, df.Rows.Count); 64foreach (var obj in df.Rows[index]) 111for (var index = 0; index < df.Rows.Count; index++) 117foreach (var obj in df.Rows[index])
Microsoft.Data.Analysis.Tests (188)
ArrowIntegrationTests.cs (1)
206Assert.Equal(0, emptyDataFrame.Rows.Count);
DataFrame.IOTests.cs (48)
156Assert.Equal(4, df.Rows.Count); 168Assert.Equal(3, reducedRows.Rows.Count); 190Assert.Equal(4, df.Rows.Count); 240Assert.Equal(4, df.Rows.Count); 269Assert.Equal(4, df.Rows.Count); 282Assert.Equal(3, reducedRows.Rows.Count); 308Assert.Equal(4, df.Rows.Count); 321Assert.Equal(3, reducedRows.Rows.Count); 335Assert.Equal(4, df.Rows.Count); 448Assert.Equal(5, df.Rows.Count); 479var nullRow = df.Rows[3]; 507Assert.Equal(5, df.Rows.Count); 543var nullRow = df.Rows[3]; 584Assert.Equal(5, df.Rows.Count); 590Assert.Equal(3, reducedRows.Rows.Count); 595var nullRow = df.Rows[3]; 623Assert.Equal(5, df.Rows.Count); 629Assert.Equal(3, reducedRows.Rows.Count); 634var nullRow = df.Rows[3]; 661Assert.Equal(4, df.Rows.Count); 667Assert.Equal(3, reducedRows.Rows.Count); 760Assert.Equal(4, df.Rows.Count); 766Assert.Equal(3, reducedRows.Rows.Count); 791Assert.Equal(6, df.Rows.Count); 834Assert.Equal(6, df.Rows.Count); 859var nullRow = df.Rows[3]; 865nullRow = df.Rows[4]; 896Assert.Equal(6, df.Rows.Count); 921var nullRow = df.Rows[3]; 927nullRow = df.Rows[4]; 965Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 985Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1016Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1049Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1087Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1114Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1141Assert.Equal(6, df.Rows.Count); 1153var nullRow = df.Rows[3]; 1156nullRow = df.Rows[4]; 1224var resVals = dataFrame.Rows.Select(row => row.ToArray()).ToArray(); 1302Assert.Equal(_rowCount, df.Rows.Count); 1316Assert.Equal(_cells[i], df.Rows[i]);
DataFrameIDataViewTests.cs (10)
110DataFrameColumn boolColumn = new PrimitiveDataFrameColumn<bool>("Bool", Enumerable.Range(0, (int)df.Rows.Count).Select(x => x % 2 == 1)); 257Assert.Equal(dfAsIDataView.GetRowCount(), newDf.Rows.Count); 271Assert.Equal(dfAsIDataView.GetRowCount(), newDf.Rows.Count); 301Assert.Equal(rowSize, newDf.Rows.Count); 324Assert.Equal(5, newDf.Rows.Count); 382Assert.Equal(6, df.Rows.Count); 399Assert.Equal(6, df.Rows.Count); 417Assert.Equal(maxRows, df.Rows.Count); 434Assert.Equal(3, df.Rows.Count); 486Assert.Equal(2, df.Rows.Count);
DataFrameTests.cs (64)
28Assert.Equal(14, (int)headList.Rows[4][1]); 31Assert.Equal(19, (int)tailList.Rows[4][1]); 36var row = dataFrame.Rows[4]; 66Assert.Equal(rowCount, dataFrame.Rows.Count); 154Assert.Equal(10, dataFrame.Rows.Count); 158Assert.Equal(0, dataFrame.Rows.Count); 173Assert.Equal(0, dataFrame.Rows.Count); 301Assert.Equal(2, count.Rows.Count); 304for (int r = 0; r < count.Rows.Count; r++) 313Assert.Equal(2, first.Rows.Count); 343Assert.Equal(6, head.Rows.Count); 346Assert.Equal(6, tail.Rows.Count); 360Assert.Equal(2, max.Rows.Count); 374Assert.Equal(2, min.Rows.Count); 377Assert.Equal(2, product.Rows.Count); 380Assert.Equal(2, sum.Rows.Count); 383Assert.Equal(2, mean.Rows.Count); 421Assert.Equal(2, countIntColumn.Rows.Count); 427Assert.Equal(2, firstDecimalColumn.Rows.Count); 438Assert.Equal(2, grouped.Rows.Count); 706Assert.Equal(7, sampled.Rows.Count); 715Assert.Equal(uniqueRowValues.Count, sampled.Rows.Count); 789Assert.Equal(18, anyNulls.Rows.Count); 792Assert.Equal(19, allNulls.Rows.Count); 860Assert.Equal(2, valueCounts.Rows.Count); 917Assert.Equal(intDfLength, clone.Rows.Count); 923for (long r = 0; r < clone.Rows.Count; r++) 962DataFrameRowCollection rows = df.Rows; 978Assert.Equal(df.Rows.Count, rowCount); 993DataFrameRowCollection rows = df.Rows; 1018Assert.Equal(10, df.Rows.Count); 1022DataFrame ret = df.Append(df2.Rows, inPlace: false); 1023Assert.Equal(10, df.Rows.Count); 1031Assert.Equal(15, ret.Rows.Count); 1034for (long i = 0; i < ret.Rows.Count; i++) 1036DataFrameRow row = ret.Rows[i]; 1039if (i < check1.Rows.Count) 1041Assert.Equal(row[j], check1.Rows[i][j]); 1045Assert.Equal(row[j]?.ToString(), (check2.Rows[i - check1.Rows.Count][j])?.ToString()); 1052df.Append(df2.Rows, inPlace: true); 1070var resultDataFrame = dataFrame.Append(dataFrame2.Rows); 1073Assert.Equal(6, resultDataFrame.Rows.Count); 1090Assert.Equal(11, df.Rows.Count); 1095Assert.Equal(12, ret.Rows.Count); 1100Assert.Equal(12, df.Rows.Count); 1105Assert.Equal(13, ret.Rows.Count); 1110Assert.Equal(13, df.Rows.Count); 1114Assert.Equal(14, ret.Rows.Count); 1119Assert.Equal(14, df.Rows.Count); 1123Assert.Equal(15, ret.Rows.Count); 1128Assert.Equal(15, df.Rows.Count); 1135Assert.Equal(16, ret.Rows.Count); 1143Assert.Equal(16, df.Rows.Count); 1149Assert.Equal(17, ret.Rows.Count); 1156Assert.Equal(17, df.Rows.Count); 1162Assert.Equal(18, ret.Rows.Count); 1174Assert.Equal(18, df.Rows.Count); 1181Assert.Equal(18, df.Rows.Count); 1186Assert.Equal(19, ret.Rows.Count); 1198Assert.Equal(11, df.Rows.Count); 1206Assert.Equal(12, df.Rows.Count); 1212Assert.Equal(13, df.Rows.Count); 1388Assert.Equal(2, filteredNullDf.Rows.Count);
DataFrameTests.Filter.cs (1)
34Assert.Equal(5, boolColumnFiltered.Rows.Count);
DataFrameTests.Join.cs (25)
25Assert.Equal(join.Rows.Count, left.Rows.Count); 32Assert.Equal(join.Rows.Count, right.Rows.Count); 40Assert.Equal(join.Rows.Count, left.Rows.Count); 47Assert.Equal(join.Rows.Count, right.Rows.Count); 57Assert.Equal(join.Rows.Count, left.Rows.Count); 64Assert.Equal(join.Rows.Count, right.Rows.Count); 72Assert.Equal(join.Rows.Count, right.Rows.Count); 79Assert.Equal(join.Rows.Count, left.Rows.Count); 87Int64DataFrameColumn mapIndices = new Int64DataFrameColumn("map", join.Rows.Count); 88for (long i = 0; i < join.Rows.Count; i++) 108DataFrameColumn compareColumn = rightColumn.Length <= join.Rows.Count ? rightColumn.Clone(numberOfNullsToAppend: join.Rows.Count - rightColumn.Length) : rightColumn.Clone(mapIndices); 117DataFrameColumn compareColumn = leftColumn.Length <= join.Rows.Count ? leftColumn.Clone(numberOfNullsToAppend: join.Rows.Count - leftColumn.Length) : leftColumn.Clone(mapIndices); 146isEqual = joinColumn.ElementwiseEquals(leftColumn.Clone(numberOfNullsToAppend: join.Rows.Count - leftColumn.Length)); 152isEqual = joinColumn.ElementwiseEquals(rightColumn.Clone(numberOfNullsToAppend: join.Rows.Count - rightColumn.Length)); 155for (int j = 0; j < join.Rows.Count; j++)
DataFrameTests.Merge.cs (26)
44Assert.Equal(10, merge.Rows.Count); 52Assert.Equal(5, merge.Rows.Count); 60Assert.Equal(merge.Rows.Count, left.Rows.Count); 67Assert.Equal(merge.Rows.Count, right.Rows.Count); 77Assert.Equal(merge.Rows.Count, left.Rows.Count); 84Assert.Equal(merge.Rows.Count, right.Rows.Count); 92Assert.Equal(16, merge.Rows.Count); 100Assert.Equal(9, merge.Rows.Count); 109DataFrameRow dataFrameMergeRow = merge.Rows[mergeRow]; 118compare = left.Rows[leftRow.Value][columnIndex]; 126compare = right.Rows[rightRow.Value][rightColumnIndex]; 151Assert.Equal(10, merge.Rows.Count); 209Assert.Equal(7, merge.Rows.Count); 259Assert.Equal(9, merge.Rows.Count); 348Assert.Equal(expectedMerged.Length, merge.Rows.Count); 407Assert.Equal(expectedMerged.Length, merge.Rows.Count); 465Assert.Equal(expectedMerged.Length, merge.Rows.Count); 521Assert.Equal(expectedMerged.Length, merge.Rows.Count); 581Assert.Equal(expectedMerged.Length, merge.Rows.Count); 637Assert.Equal(expectedMerged.Length, merge.Rows.Count); 693Assert.Equal(expectedMerged.Length, merge.Rows.Count); 710Assert.Equal(2, merge.Rows.Count);
DataFrameTests.Sort.cs (9)
21df.Columns["Int"][df.Rows.Count - 1] = -1; 28Assert.Null(sortedDf.Columns["Int"][sortedDf.Rows.Count - 1]); 30Assert.Equal(100000, sortedDf.Columns["Int"][sortedDf.Rows.Count - 3]); 31Assert.Equal(200000, sortedDf.Columns["Int"][sortedDf.Rows.Count - 2]); 111Assert.Equal(10, sortedDataFrame.Rows.Count); 112DataFrameRow lastRow = sortedDataFrame.Rows[sortedDataFrame.Rows.Count - 1]; 113DataFrameRow penultimateRow = sortedDataFrame.Rows[sortedDataFrame.Rows.Count - 2];
DataFrameTests.Utils.cs (3)
224IEnumerable<int> randomIndices = Enumerable.Range(0, (int)input.Rows.Count); 225IEnumerable<int> trainIndices = randomIndices.Take((int)(input.Rows.Count * testRatio)); 226IEnumerable<int> testIndices = randomIndices.Skip((int)(input.Rows.Count * testRatio));
PrimitiveDataFrameColumnTests.cs (1)
517Assert.Equal(2, filteredNullDf.Rows.Count);
Microsoft.ML.Fairlearn (4)
Metrics\FairlearnMetricCatalog.cs (1)
186var groups = evalDf.Rows.GroupBy(r => r[sensitiveCol.Index]);
Reductions\UtilityParity.cs (3)
125gSigned.Append(dfNeg.Rows, inPlace: true); 150long dataSetLength = Tags.Rows.Count(); 154foreach (DataFrameRow row in Tags.Rows)