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)
217Assert.Equal(0, emptyDataFrame.Rows.Count);
DataFrame.IOTests.cs (48)
162Assert.Equal(4, df.Rows.Count); 174Assert.Equal(3, reducedRows.Rows.Count); 196Assert.Equal(4, df.Rows.Count); 246Assert.Equal(4, df.Rows.Count); 275Assert.Equal(4, df.Rows.Count); 288Assert.Equal(3, reducedRows.Rows.Count); 314Assert.Equal(4, df.Rows.Count); 327Assert.Equal(3, reducedRows.Rows.Count); 341Assert.Equal(4, df.Rows.Count); 454Assert.Equal(5, df.Rows.Count); 485var nullRow = df.Rows[3]; 513Assert.Equal(5, df.Rows.Count); 549var nullRow = df.Rows[3]; 590Assert.Equal(5, df.Rows.Count); 596Assert.Equal(3, reducedRows.Rows.Count); 601var nullRow = df.Rows[3]; 629Assert.Equal(5, df.Rows.Count); 635Assert.Equal(3, reducedRows.Rows.Count); 640var nullRow = df.Rows[3]; 667Assert.Equal(4, df.Rows.Count); 673Assert.Equal(3, reducedRows.Rows.Count); 766Assert.Equal(4, df.Rows.Count); 772Assert.Equal(3, reducedRows.Rows.Count); 797Assert.Equal(6, df.Rows.Count); 840Assert.Equal(6, df.Rows.Count); 865var nullRow = df.Rows[3]; 871nullRow = df.Rows[4]; 902Assert.Equal(6, df.Rows.Count); 927var nullRow = df.Rows[3]; 933nullRow = df.Rows[4]; 971Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 991Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1022Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1055Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1093Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1120Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); 1147Assert.Equal(6, df.Rows.Count); 1159var nullRow = df.Rows[3]; 1162nullRow = df.Rows[4]; 1230var resVals = dataFrame.Rows.Select(row => row.ToArray()).ToArray(); 1308Assert.Equal(_rowCount, df.Rows.Count); 1322Assert.Equal(_cells[i], df.Rows[i]);
DataFrameIDataViewTests.cs (10)
116DataFrameColumn boolColumn = new PrimitiveDataFrameColumn<bool>("Bool", Enumerable.Range(0, (int)df.Rows.Count).Select(x => x % 2 == 1)); 263Assert.Equal(dfAsIDataView.GetRowCount(), newDf.Rows.Count); 277Assert.Equal(dfAsIDataView.GetRowCount(), newDf.Rows.Count); 307Assert.Equal(rowSize, newDf.Rows.Count); 330Assert.Equal(5, newDf.Rows.Count); 388Assert.Equal(6, df.Rows.Count); 405Assert.Equal(6, df.Rows.Count); 423Assert.Equal(maxRows, df.Rows.Count); 440Assert.Equal(3, df.Rows.Count); 492Assert.Equal(2, df.Rows.Count);
DataFrameTests.cs (64)
30Assert.Equal(14, (int)headList.Rows[4][1]); 33Assert.Equal(19, (int)tailList.Rows[4][1]); 38var row = dataFrame.Rows[4]; 68Assert.Equal(rowCount, dataFrame.Rows.Count); 156Assert.Equal(10, dataFrame.Rows.Count); 160Assert.Equal(0, dataFrame.Rows.Count); 175Assert.Equal(0, dataFrame.Rows.Count); 303Assert.Equal(2, count.Rows.Count); 306for (int r = 0; r < count.Rows.Count; r++) 315Assert.Equal(2, first.Rows.Count); 345Assert.Equal(6, head.Rows.Count); 348Assert.Equal(6, tail.Rows.Count); 362Assert.Equal(2, max.Rows.Count); 376Assert.Equal(2, min.Rows.Count); 379Assert.Equal(2, product.Rows.Count); 382Assert.Equal(2, sum.Rows.Count); 385Assert.Equal(2, mean.Rows.Count); 423Assert.Equal(2, countIntColumn.Rows.Count); 429Assert.Equal(2, firstDecimalColumn.Rows.Count); 440Assert.Equal(2, grouped.Rows.Count); 708Assert.Equal(7, sampled.Rows.Count); 717Assert.Equal(uniqueRowValues.Count, sampled.Rows.Count); 791Assert.Equal(18, anyNulls.Rows.Count); 794Assert.Equal(19, allNulls.Rows.Count); 862Assert.Equal(2, valueCounts.Rows.Count); 919Assert.Equal(intDfLength, clone.Rows.Count); 925for (long r = 0; r < clone.Rows.Count; r++) 964DataFrameRowCollection rows = df.Rows; 980Assert.Equal(df.Rows.Count, rowCount); 995DataFrameRowCollection rows = df.Rows; 1020Assert.Equal(10, df.Rows.Count); 1024DataFrame ret = df.Append(df2.Rows, inPlace: false); 1025Assert.Equal(10, df.Rows.Count); 1033Assert.Equal(15, ret.Rows.Count); 1036for (long i = 0; i < ret.Rows.Count; i++) 1038DataFrameRow row = ret.Rows[i]; 1041if (i < check1.Rows.Count) 1043Assert.Equal(row[j], check1.Rows[i][j]); 1047Assert.Equal(row[j]?.ToString(), (check2.Rows[i - check1.Rows.Count][j])?.ToString()); 1054df.Append(df2.Rows, inPlace: true); 1072var resultDataFrame = dataFrame.Append(dataFrame2.Rows); 1075Assert.Equal(6, resultDataFrame.Rows.Count); 1092Assert.Equal(11, df.Rows.Count); 1097Assert.Equal(12, ret.Rows.Count); 1102Assert.Equal(12, df.Rows.Count); 1107Assert.Equal(13, ret.Rows.Count); 1112Assert.Equal(13, df.Rows.Count); 1116Assert.Equal(14, ret.Rows.Count); 1121Assert.Equal(14, df.Rows.Count); 1125Assert.Equal(15, ret.Rows.Count); 1130Assert.Equal(15, df.Rows.Count); 1137Assert.Equal(16, ret.Rows.Count); 1145Assert.Equal(16, df.Rows.Count); 1151Assert.Equal(17, ret.Rows.Count); 1158Assert.Equal(17, df.Rows.Count); 1164Assert.Equal(18, ret.Rows.Count); 1176Assert.Equal(18, df.Rows.Count); 1183Assert.Equal(18, df.Rows.Count); 1188Assert.Equal(19, ret.Rows.Count); 1200Assert.Equal(11, df.Rows.Count); 1208Assert.Equal(12, df.Rows.Count); 1214Assert.Equal(13, df.Rows.Count); 1390Assert.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)
523Assert.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)