113 instantiations of DataFrame
Microsoft.Data.Analysis (60)
DataFrame.Arrow.cs (1)
157DataFrame ret = new DataFrame();
DataFrame.BinaryOperations.cs (38)
22DataFrame retDataFrame = inPlace ? this : new DataFrame(); 41DataFrame retDataFrame = inPlace ? this : new DataFrame(); 61DataFrame retDataFrame = inPlace ? this : new DataFrame(); 80DataFrame retDataFrame = inPlace ? this : new DataFrame(); 100DataFrame retDataFrame = inPlace ? this : new DataFrame(); 119DataFrame retDataFrame = inPlace ? this : new DataFrame(); 139DataFrame retDataFrame = inPlace ? this : new DataFrame(); 158DataFrame retDataFrame = inPlace ? this : new DataFrame(); 178DataFrame retDataFrame = inPlace ? this : new DataFrame(); 197DataFrame retDataFrame = inPlace ? this : new DataFrame(); 216DataFrame retDataFrame = inPlace ? this : new DataFrame(); 234DataFrame retDataFrame = inPlace ? this : new DataFrame(); 253DataFrame retDataFrame = inPlace ? this : new DataFrame(); 271DataFrame retDataFrame = inPlace ? this : new DataFrame(); 290DataFrame retDataFrame = inPlace ? this : new DataFrame(); 308DataFrame retDataFrame = inPlace ? this : new DataFrame(); 326DataFrame retDataFrame = inPlace ? this : new DataFrame(); 344DataFrame retDataFrame = inPlace ? this : new DataFrame(); 364DataFrame retDataFrame = new DataFrame(); 380DataFrame retDataFrame = new DataFrame(); 397DataFrame retDataFrame = new DataFrame(); 413DataFrame retDataFrame = new DataFrame(); 430DataFrame retDataFrame = new DataFrame(); 446DataFrame retDataFrame = new DataFrame(); 463DataFrame retDataFrame = new DataFrame(); 479DataFrame retDataFrame = new DataFrame(); 496DataFrame retDataFrame = new DataFrame(); 512DataFrame retDataFrame = new DataFrame(); 529DataFrame retDataFrame = new DataFrame(); 545DataFrame retDataFrame = new DataFrame(); 562DataFrame retDataFrame = inPlace ? this : new DataFrame(); 580DataFrame retDataFrame = inPlace ? this : new DataFrame(); 598DataFrame retDataFrame = inPlace ? this : new DataFrame(); 616DataFrame retDataFrame = inPlace ? this : new DataFrame(); 634DataFrame retDataFrame = inPlace ? this : new DataFrame(); 651DataFrame retDataFrame = inPlace ? this : new DataFrame(); 668DataFrame retDataFrame = inPlace ? this : new DataFrame(); 685DataFrame retDataFrame = inPlace ? this : new DataFrame();
DataFrame.cs (4)
205return new DataFrame(newColumns); 213DataFrame ret = new DataFrame(); 236DataFrame ret = new DataFrame(); 691return new DataFrame(newColumns);
DataFrame.IO.cs (3)
132var res = new DataFrame(columns); 195var res = new DataFrame(columns); 450DataFrame ret = new DataFrame(columns);
DataFrame.Join.cs (2)
49DataFrame ret = new DataFrame(); 404DataFrame ret = new DataFrame();
DataFrameColumns\StringDataFrameColumn.cs (1)
393return new DataFrame(new List<DataFrameColumn> { keys, counts });
GroupBy.cs (9)
144DataFrame ret = new DataFrame(); 187DataFrame ret = new DataFrame(); 229DataFrame ret = new DataFrame(); 283DataFrame ret = new DataFrame(); 357DataFrame ret = new DataFrame(); 385DataFrame ret = new DataFrame(); 413DataFrame ret = new DataFrame(); 441DataFrame ret = new DataFrame(); 469DataFrame ret = new DataFrame();
IDataView.Extension.cs (1)
148return new DataFrame(dataFrameColumns);
PrimitiveDataFrameColumn.cs (1)
391return new DataFrame(new List<DataFrameColumn> { keys, counts });
Microsoft.Data.Analysis.Interactive (1)
TabularDataResourceExtensions.cs (1)
22var dataFrame = new DataFrame();
Microsoft.Data.Analysis.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
29DataFrame dataFrame = new DataFrame();
Microsoft.Data.Analysis.Tests (37)
ArrowIntegrationTests.cs (1)
146DataFrame df = new DataFrame(new List<DataFrameColumn>() { ageColumn, lengthColumn, stringColumn });
DataFrame.IOTests.cs (1)
962DataFrame dataFrame = new DataFrame(vBufferColumn);
DataFrameTests.BinaryOperations.cs (4)
173var df = new DataFrame(); 205var df = new DataFrame(); 247var df = new DataFrame(); 303var df = new DataFrame();
DataFrameTests.Computations.cs (2)
484var dfTest = new DataFrame(col1, col2); 501var dfTest = new DataFrame(col1, col2);
DataFrameTests.cs (10)
65DataFrame dataFrame = new DataFrame(); 108DataFrame dataFrame1 = new DataFrame(intColumn, floatColumn); 151DataFrame dataFrame = new DataFrame(); 185DataFrame dataframe = new DataFrame(city, temp); 204DataFrame dataframe = new DataFrame(city, temp); 800DataFrame df = new DataFrame(); 1061var dataFrame = new DataFrame( 1067var dataFrame2 = new DataFrame( 1366var dfTest = new DataFrame(col); 1383var dfTest = new DataFrame(index, col);
DataFrameTests.Merge.cs (14)
298var left = new DataFrame(); 303var right = new DataFrame(); 364var left = new DataFrame(); 369var right = new DataFrame(); 422var left = new DataFrame(); 427var right = new DataFrame(); 480var left = new DataFrame(); 485var right = new DataFrame(); 536var left = new DataFrame(); 541var right = new DataFrame(); 596var left = new DataFrame(); 602var right = new DataFrame(); 652var left = new DataFrame(); 658var right = new DataFrame();
DataFrameTests.Utils.cs (3)
26DataFrame dataFrame = new DataFrame(); 190var dataFrame = new DataFrame(columnsList); 209DataFrame dataFrame = new DataFrame(new List<DataFrameColumn> { baseColumn1, baseColumn2 });
PrimitiveDataFrameColumnTests.cs (2)
499var dfTest = new DataFrame(col); 516var dfTest = new DataFrame(index, col);
Microsoft.ML.AutoML.Interactive (1)
NotebookMonitor.cs (1)
30TrialData = new DataFrame(new PrimitiveDataFrameColumn<int>("Trial"), new PrimitiveDataFrameColumn<float>("Metric"), new StringDataFrameColumn("Trainer"), new StringDataFrameColumn("Parameters"));
Microsoft.ML.Fairlearn (9)
Metrics\FairlearnMetricCatalog.cs (3)
99DataFrame result = new DataFrame(); 190var data = new DataFrame(_eval.Schema.AsEnumerable().Select<DataViewSchema.Column, DataFrameColumn>(column => 233DataFrame result = new DataFrame();
Reductions\GridSearchTrialRunner.cs (2)
72var df = new DataFrame(); 78trainDataset = ZipDataView.Create(_context, new IDataView[] { trainDataset, new DataFrame(signWeightColumn) });
Reductions\Moment.cs (1)
49Tags = new DataFrame();
Reductions\UtilityParity.cs (3)
114DataFrame gSigned = new DataFrame(posSign, groupID, upperBoundDiff); 121DataFrame dfNeg = new DataFrame(negSign, groupID, lowerBoundDiff); 147DataFrame lookUp = new DataFrame(gPos["group_id"], adjust);
Microsoft.ML.Fairlearn.Tests (4)
GridSearchTest.cs (2)
38var df = new DataFrame(); 62var df = new DataFrame();
MetricTest.cs (1)
69DataFrame df = new DataFrame(label, groupId, pred, score, prob);
UtilityTest.cs (1)
27DataFrame x = new DataFrame();
892 references to DataFrame
Microsoft.Data.Analysis (462)
DataFrame.Arrow.cs (5)
14private static void AppendDataFrameColumnFromArrowArray(Field field, IArrowArray arrowArray, DataFrame ret, string fieldNamePrefix = "") 151/// Wraps a <see cref="DataFrame"/> around an Arrow <see cref="RecordBatch"/> without copying data 154/// <returns><see cref="DataFrame"/></returns> 155public static DataFrame FromArrowRecordBatch(RecordBatch recordBatch) 157DataFrame ret = new DataFrame();
DataFrame.BinaryOperations.cs (76)
15public DataFrame Add<T>(IReadOnlyList<T> values, bool inPlace = false) 22DataFrame retDataFrame = inPlace ? this : new DataFrame(); 38public DataFrame Add<T>(T value, bool inPlace = false) 41DataFrame retDataFrame = inPlace ? this : new DataFrame(); 54public DataFrame Subtract<T>(IReadOnlyList<T> values, bool inPlace = false) 61DataFrame retDataFrame = inPlace ? this : new DataFrame(); 77public DataFrame Subtract<T>(T value, bool inPlace = false) 80DataFrame retDataFrame = inPlace ? this : new DataFrame(); 93public DataFrame Multiply<T>(IReadOnlyList<T> values, bool inPlace = false) 100DataFrame retDataFrame = inPlace ? this : new DataFrame(); 116public DataFrame Multiply<T>(T value, bool inPlace = false) 119DataFrame retDataFrame = inPlace ? this : new DataFrame(); 132public DataFrame Divide<T>(IReadOnlyList<T> values, bool inPlace = false) 139DataFrame retDataFrame = inPlace ? this : new DataFrame(); 155public DataFrame Divide<T>(T value, bool inPlace = false) 158DataFrame retDataFrame = inPlace ? this : new DataFrame(); 171public DataFrame Modulo<T>(IReadOnlyList<T> values, bool inPlace = false) 178DataFrame retDataFrame = inPlace ? this : new DataFrame(); 194public DataFrame Modulo<T>(T value, bool inPlace = false) 197DataFrame retDataFrame = inPlace ? this : new DataFrame(); 210public DataFrame And(IReadOnlyList<bool> values, bool inPlace = false) 216DataFrame retDataFrame = inPlace ? this : new DataFrame(); 232public DataFrame And(bool value, bool inPlace = false) 234DataFrame retDataFrame = inPlace ? this : new DataFrame(); 247public DataFrame Or(IReadOnlyList<bool> values, bool inPlace = false) 253DataFrame retDataFrame = inPlace ? this : new DataFrame(); 269public DataFrame Or(bool value, bool inPlace = false) 271DataFrame retDataFrame = inPlace ? this : new DataFrame(); 284public DataFrame Xor(IReadOnlyList<bool> values, bool inPlace = false) 290DataFrame retDataFrame = inPlace ? this : new DataFrame(); 306public DataFrame Xor(bool value, bool inPlace = false) 308DataFrame retDataFrame = inPlace ? this : new DataFrame(); 324public DataFrame LeftShift(int value, bool inPlace = false) 326DataFrame retDataFrame = inPlace ? this : new DataFrame(); 342public DataFrame RightShift(int value, bool inPlace = false) 344DataFrame retDataFrame = inPlace ? this : new DataFrame(); 357public DataFrame ElementwiseEquals<T>(IReadOnlyList<T> values) 364DataFrame retDataFrame = new DataFrame(); 377public DataFrame ElementwiseEquals<T>(T value) 380DataFrame retDataFrame = new DataFrame(); 390public DataFrame ElementwiseNotEquals<T>(IReadOnlyList<T> values) 397DataFrame retDataFrame = new DataFrame(); 410public DataFrame ElementwiseNotEquals<T>(T value) 413DataFrame retDataFrame = new DataFrame(); 423public DataFrame ElementwiseGreaterThanOrEqual<T>(IReadOnlyList<T> values) 430DataFrame retDataFrame = new DataFrame(); 443public DataFrame ElementwiseGreaterThanOrEqual<T>(T value) 446DataFrame retDataFrame = new DataFrame(); 456public DataFrame ElementwiseLessThanOrEqual<T>(IReadOnlyList<T> values) 463DataFrame retDataFrame = new DataFrame(); 476public DataFrame ElementwiseLessThanOrEqual<T>(T value) 479DataFrame retDataFrame = new DataFrame(); 489public DataFrame ElementwiseGreaterThan<T>(IReadOnlyList<T> values) 496DataFrame retDataFrame = new DataFrame(); 509public DataFrame ElementwiseGreaterThan<T>(T value) 512DataFrame retDataFrame = new DataFrame(); 522public DataFrame ElementwiseLessThan<T>(IReadOnlyList<T> values) 529DataFrame retDataFrame = new DataFrame(); 542public DataFrame ElementwiseLessThan<T>(T value) 545DataFrame retDataFrame = new DataFrame(); 559public DataFrame ReverseAdd<T>(T value, bool inPlace = false) 562DataFrame retDataFrame = inPlace ? this : new DataFrame(); 577public DataFrame ReverseSubtract<T>(T value, bool inPlace = false) 580DataFrame retDataFrame = inPlace ? this : new DataFrame(); 595public DataFrame ReverseMultiply<T>(T value, bool inPlace = false) 598DataFrame retDataFrame = inPlace ? this : new DataFrame(); 613public DataFrame ReverseDivide<T>(T value, bool inPlace = false) 616DataFrame retDataFrame = inPlace ? this : new DataFrame(); 631public DataFrame ReverseModulo<T>(T value, bool inPlace = false) 634DataFrame retDataFrame = inPlace ? this : new DataFrame(); 649public DataFrame ReverseAnd(bool value, bool inPlace = false) 651DataFrame retDataFrame = inPlace ? this : new DataFrame(); 666public DataFrame ReverseOr(bool value, bool inPlace = false) 668DataFrame retDataFrame = inPlace ? this : new DataFrame(); 683public DataFrame ReverseXor(bool value, bool inPlace = false) 685DataFrame retDataFrame = inPlace ? this : new DataFrame();
DataFrame.BinaryOperators.cs (224)
16public static DataFrame operator +(DataFrame df, byte value) 21public static DataFrame operator +(byte value, DataFrame df) 26public static DataFrame operator +(DataFrame df, decimal value) 31public static DataFrame operator +(decimal value, DataFrame df) 36public static DataFrame operator +(DataFrame df, double value) 41public static DataFrame operator +(double value, DataFrame df) 46public static DataFrame operator +(DataFrame df, float value) 51public static DataFrame operator +(float value, DataFrame df) 56public static DataFrame operator +(DataFrame df, int value) 61public static DataFrame operator +(int value, DataFrame df) 66public static DataFrame operator +(DataFrame df, long value) 71public static DataFrame operator +(long value, DataFrame df) 76public static DataFrame operator +(DataFrame df, sbyte value) 81public static DataFrame operator +(sbyte value, DataFrame df) 86public static DataFrame operator +(DataFrame df, short value) 91public static DataFrame operator +(short value, DataFrame df) 96public static DataFrame operator +(DataFrame df, uint value) 101public static DataFrame operator +(uint value, DataFrame df) 106public static DataFrame operator +(DataFrame df, ulong value) 111public static DataFrame operator +(ulong value, DataFrame df) 116public static DataFrame operator +(DataFrame df, ushort value) 121public static DataFrame operator +(ushort value, DataFrame df) 126public static DataFrame operator -(DataFrame df, byte value) 131public static DataFrame operator -(byte value, DataFrame df) 136public static DataFrame operator -(DataFrame df, decimal value) 141public static DataFrame operator -(decimal value, DataFrame df) 146public static DataFrame operator -(DataFrame df, double value) 151public static DataFrame operator -(double value, DataFrame df) 156public static DataFrame operator -(DataFrame df, float value) 161public static DataFrame operator -(float value, DataFrame df) 166public static DataFrame operator -(DataFrame df, int value) 171public static DataFrame operator -(int value, DataFrame df) 176public static DataFrame operator -(DataFrame df, long value) 181public static DataFrame operator -(long value, DataFrame df) 186public static DataFrame operator -(DataFrame df, sbyte value) 191public static DataFrame operator -(sbyte value, DataFrame df) 196public static DataFrame operator -(DataFrame df, short value) 201public static DataFrame operator -(short value, DataFrame df) 206public static DataFrame operator -(DataFrame df, uint value) 211public static DataFrame operator -(uint value, DataFrame df) 216public static DataFrame operator -(DataFrame df, ulong value) 221public static DataFrame operator -(ulong value, DataFrame df) 226public static DataFrame operator -(DataFrame df, ushort value) 231public static DataFrame operator -(ushort value, DataFrame df) 236public static DataFrame operator *(DataFrame df, byte value) 241public static DataFrame operator *(byte value, DataFrame df) 246public static DataFrame operator *(DataFrame df, decimal value) 251public static DataFrame operator *(decimal value, DataFrame df) 256public static DataFrame operator *(DataFrame df, double value) 261public static DataFrame operator *(double value, DataFrame df) 266public static DataFrame operator *(DataFrame df, float value) 271public static DataFrame operator *(float value, DataFrame df) 276public static DataFrame operator *(DataFrame df, int value) 281public static DataFrame operator *(int value, DataFrame df) 286public static DataFrame operator *(DataFrame df, long value) 291public static DataFrame operator *(long value, DataFrame df) 296public static DataFrame operator *(DataFrame df, sbyte value) 301public static DataFrame operator *(sbyte value, DataFrame df) 306public static DataFrame operator *(DataFrame df, short value) 311public static DataFrame operator *(short value, DataFrame df) 316public static DataFrame operator *(DataFrame df, uint value) 321public static DataFrame operator *(uint value, DataFrame df) 326public static DataFrame operator *(DataFrame df, ulong value) 331public static DataFrame operator *(ulong value, DataFrame df) 336public static DataFrame operator *(DataFrame df, ushort value) 341public static DataFrame operator *(ushort value, DataFrame df) 346public static DataFrame operator /(DataFrame df, byte value) 351public static DataFrame operator /(byte value, DataFrame df) 356public static DataFrame operator /(DataFrame df, decimal value) 361public static DataFrame operator /(decimal value, DataFrame df) 366public static DataFrame operator /(DataFrame df, double value) 371public static DataFrame operator /(double value, DataFrame df) 376public static DataFrame operator /(DataFrame df, float value) 381public static DataFrame operator /(float value, DataFrame df) 386public static DataFrame operator /(DataFrame df, int value) 391public static DataFrame operator /(int value, DataFrame df) 396public static DataFrame operator /(DataFrame df, long value) 401public static DataFrame operator /(long value, DataFrame df) 406public static DataFrame operator /(DataFrame df, sbyte value) 411public static DataFrame operator /(sbyte value, DataFrame df) 416public static DataFrame operator /(DataFrame df, short value) 421public static DataFrame operator /(short value, DataFrame df) 426public static DataFrame operator /(DataFrame df, uint value) 431public static DataFrame operator /(uint value, DataFrame df) 436public static DataFrame operator /(DataFrame df, ulong value) 441public static DataFrame operator /(ulong value, DataFrame df) 446public static DataFrame operator /(DataFrame df, ushort value) 451public static DataFrame operator /(ushort value, DataFrame df) 456public static DataFrame operator %(DataFrame df, byte value) 461public static DataFrame operator %(byte value, DataFrame df) 466public static DataFrame operator %(DataFrame df, decimal value) 471public static DataFrame operator %(decimal value, DataFrame df) 476public static DataFrame operator %(DataFrame df, double value) 481public static DataFrame operator %(double value, DataFrame df) 486public static DataFrame operator %(DataFrame df, float value) 491public static DataFrame operator %(float value, DataFrame df) 496public static DataFrame operator %(DataFrame df, int value) 501public static DataFrame operator %(int value, DataFrame df) 506public static DataFrame operator %(DataFrame df, long value) 511public static DataFrame operator %(long value, DataFrame df) 516public static DataFrame operator %(DataFrame df, sbyte value) 521public static DataFrame operator %(sbyte value, DataFrame df) 526public static DataFrame operator %(DataFrame df, short value) 531public static DataFrame operator %(short value, DataFrame df) 536public static DataFrame operator %(DataFrame df, uint value) 541public static DataFrame operator %(uint value, DataFrame df) 546public static DataFrame operator %(DataFrame df, ulong value) 551public static DataFrame operator %(ulong value, DataFrame df) 556public static DataFrame operator %(DataFrame df, ushort value) 561public static DataFrame operator %(ushort value, DataFrame df) 566public static DataFrame operator <<(DataFrame df, int value) 571public static DataFrame operator >>(DataFrame df, int value)
DataFrame.cs (53)
41/// Constructs a <see cref="DataFrame"/> with <paramref name="columns"/>. 43/// <param name="columns">The columns of this <see cref="DataFrame"/>.</param> 57/// Returns the columns contained in the <see cref="DataFrame"/> as a <see cref="DataFrameColumnCollection"/> 62/// Returns a <see cref="DataFrameRowCollection"/> that contains a view of the rows in this <see cref="DataFrame"/> 85public DataFrame Filter(PrimitiveDataFrameColumn<bool> filter) => Clone(filter); 91public DataFrame Filter(PrimitiveDataFrameColumn<int> rowIndices) => Clone(rowIndices); 97public DataFrame Filter(PrimitiveDataFrameColumn<long> rowIndices) => Clone(rowIndices); 103public DataFrame this[PrimitiveDataFrameColumn<bool> rowFilter] => Filter(rowFilter); 109public DataFrame this[PrimitiveDataFrameColumn<int> rowIndices] => Filter(rowIndices); 115public DataFrame this[PrimitiveDataFrameColumn<long> rowIndices] => Filter(rowIndices); 120public DataFrame this[IEnumerable<int> rowIndices] 132public DataFrame this[IEnumerable<long> rowIndices] 144public DataFrame this[IEnumerable<bool> rowFilter] 158/// <exception cref="ArgumentException">Throws if <paramref name="columnName"/> is not present in this <see cref="DataFrame"/></exception> 169public DataFrame Head(int numberOfRows) 178public DataFrame Tail(int numberOfRows) 193public DataFrame Clone() 198private DataFrame Clone(DataFrameColumn mapIndices = null) 211public DataFrame Info() 213DataFrame ret = new DataFrame(); 234public DataFrame Description() 236DataFrame ret = new DataFrame(); 266public DataFrame OrderBy(string columnName, bool ascending = true, bool putNullValuesLast = true) 276public DataFrame OrderByDescending(string columnName, bool putNullValuesLast = true) 288public DataFrame Clamp<U>(U min, U max, bool inPlace = false) 290DataFrame ret = inPlace ? this : Clone(); 304public DataFrame AddPrefix(string prefix, bool inPlace = false) 306DataFrame df = inPlace ? this : Clone(); 319public DataFrame AddSuffix(string suffix, bool inPlace = false) 321DataFrame df = inPlace ? this : Clone(); 335public DataFrame Sample(int numberOfRows) 363/// Groups the rows of the <see cref="DataFrame"/> by unique values in the <paramref name="columnName"/> column. 378/// Groups the rows of the <see cref="DataFrame"/> by unique values in the <paramref name="columnName"/> column. 412public DataFrame DropNulls(DropNullOptions options = DropNullOptions.Any) 464/// <returns>A new <see cref="DataFrame"/> if <paramref name="inPlace"/> is not set. Returns this <see cref="DataFrame"/> otherwise.</returns> 465public DataFrame FillNulls(object value, bool inPlace = false) 467DataFrame ret = inPlace ? this : Clone(); 478/// <param name="values">The values to replace <see langword="null" /> with, one value per column. Should be equal to the number of columns in this <see cref="DataFrame"/>. </param> 480/// <returns>A new <see cref="DataFrame"/> if <paramref name="inPlace"/> is not set. Returns this <see cref="DataFrame"/> otherwise.</returns> 481public DataFrame FillNulls(IList<object> values, bool inPlace = false) 486DataFrame ret = inPlace ? this : Clone(); 510public DataFrame Append(IEnumerable<DataFrameRow> rows, bool inPlace = false, CultureInfo cultureInfo = null) 512DataFrame ret = inPlace ? this : Clone(); 528public DataFrame Append(IEnumerable<object> row = null, bool inPlace = false, CultureInfo cultureInfo = null) 535DataFrame ret = inPlace ? this : Clone(); 611public DataFrame Append(IEnumerable<KeyValuePair<string, object>> row, bool inPlace = false, CultureInfo cultureInfo = null) 618DataFrame ret = inPlace ? this : Clone(); 678private DataFrame Sort(string columnName, bool ascending, bool putNullValuesLast) 695/// A preview of the contents of this <see cref="DataFrame"/> as a string. 697/// <returns>A preview of the contents of this <see cref="DataFrame"/>.</returns> 701/// A preview of the contents of this <see cref="DataFrame"/> as a string.
DataFrame.IDataView.cs (2)
72private readonly DataFrame _dataFrame; 75public RowCursor(DataFrame dataFrame, bool[] activeColumns)
DataFrame.IO.cs (22)
106public static DataFrame LoadCsv(string filename, 121public static DataFrame LoadFrom(IEnumerable<IList<object>> vals, IList<(string, Type)> columnInfos) 132var res = new DataFrame(columns); 182public static DataFrame FromSchema(DbDataReader reader) 195var res = new DataFrame(columns); 199public static async Task<DataFrame> LoadFrom(DbDataReader reader) 201var res = FromSchema(reader); 221public static async Task<DataFrame> LoadFrom(DbDataAdapter adapter) 355private static DataFrame ReadCsvLinesIntoDataFrame(WrappedStreamReaderOrStringReader wrappedReader, 450DataFrame ret = new DataFrame(columns); 539/// <returns><see cref="DataFrame"/></returns> 540public static DataFrame LoadCsvFromString(string csvString, 566/// <returns><see cref="DataFrame"/></returns> 567public static DataFrame LoadCsv(Stream csvStream, 591/// <param name="dataFrame"><see cref="DataFrame"/></param> 598public static void WriteCsv(DataFrame dataFrame, string path, 608/// <param name="dataFrame"><see cref="DataFrame"/></param> 614public static void SaveCsv(DataFrame dataFrame, string path, 629/// <param name="dataFrame"><see cref="DataFrame"/></param> 636public static void WriteCsv(DataFrame dataFrame, Stream csvStream, 646/// <param name="dataFrame"><see cref="DataFrame"/></param> 652public static void SaveCsv(DataFrame dataFrame, Stream csvStream,
DataFrame.Join.cs (20)
26private void SetSuffixForDuplicatedColumnNames(DataFrame dataFrame, DataFrameColumn column, string leftSuffix, string rightSuffix) 40/// Joins columns of another <see cref="DataFrame"/> 42/// <param name="other">The other <see cref="DataFrame"/> to join.</param> 43/// <param name="leftSuffix">The suffix to add to this <see cref="DataFrame"/>'s column if there are common column names</param> 46/// <returns>A new <see cref="DataFrame"/></returns> 47public DataFrame Join(DataFrame other, string leftSuffix = "_left", string rightSuffix = "_right", JoinAlgorithm joinAlgorithm = JoinAlgorithm.Left) 49DataFrame ret = new DataFrame(); 166public DataFrame Merge<TKey>(DataFrame other, string leftJoinColumn, string rightJoinColumn, string leftSuffix = "_left", string rightSuffix = "_right", JoinAlgorithm joinAlgorithm = JoinAlgorithm.Left) 171private static HashSet<long> Merge(DataFrame retainedDataFrame, DataFrame supplementaryDataFrame, 192private static Dictionary<long, ICollection<long>> GetOccurences(DataFrame retainedDataFrame, DataFrame supplementaryDataFrame, 275private static HashSet<long> PerformMerging(DataFrame retainedDataFrame, string[] retainedJoinColumnNames, 331public DataFrame Merge(DataFrame other, string[] leftJoinColumns, string[] rightJoinColumns, string leftSuffix = "_left", string rightSuffix = "_right", JoinAlgorithm joinAlgorithm = JoinAlgorithm.Left) 341DataFrame supplementaryDataFrame; 342DataFrame retainedDataFrame; 404DataFrame ret = new DataFrame();
DataFrameColumn.cs (4)
141public void SetName(string newName, DataFrame dataFrame) => SetName(newName); 298public virtual DataFrame ValueCounts() => throw new NotImplementedException(); 300public virtual GroupBy GroupBy(int columnIndex, DataFrame parent) => throw new NotImplementedException(); 434return ToString(DataFrame.DefaultMaxRowsToShowInPreview);
DataFrameColumnCollection.cs (1)
180/// <exception cref="ArgumentException">Throws if <paramref name="columnName"/> is not present in this <see cref="DataFrame"/></exception>
DataFrameColumns\ArrowStringDataFrameColumn.cs (2)
475public override DataFrame ValueCounts() 482public override GroupBy GroupBy(int columnIndex, DataFrame parent)
DataFrameColumns\StringDataFrameColumn.cs (3)
384internal static DataFrame ValueCountsImplementation(Dictionary<string, ICollection<long>> groupedValues) 396public override DataFrame ValueCounts() 402public override GroupBy GroupBy(int columnIndex, DataFrame parent)
DataFrameRow.cs (3)
15/// A DataFrameRow is a collection of values that represent a row in a <see cref="DataFrame"/>. 19private readonly DataFrame _dataFrame; 22internal DataFrameRow(DataFrame df, long rowIndex)
DataFrameRowCollection.cs (4)
12/// Represents the rows of a <see cref="DataFrame"/> 16private readonly DataFrame _dataFrame; 21internal DataFrameRowCollection(DataFrame dataFrame) 50/// The number of rows in this <see cref="DataFrame"/>.
GroupBy.cs (30)
22public abstract DataFrame Count(params string[] columnNames); 28public abstract DataFrame First(params string[] columnNames); 35public abstract DataFrame Head(int numberOfRows); 42public abstract DataFrame Tail(int numberOfRows); 48public abstract DataFrame Max(params string[] columnNames); 54public abstract DataFrame Min(params string[] columnNames); 60public abstract DataFrame Product(params string[] columnNames); 66public abstract DataFrame Sum(params string[] columnNames); 72public abstract DataFrame Mean(params string[] columnNames); 106private readonly DataFrame _dataFrame; 108public GroupBy(DataFrame dataFrame, int groupByColumnIndex, IDictionary<TKey, ICollection<long>> keyToRowIndices) 142public override DataFrame Count(params string[] columnNames) 144DataFrame ret = new DataFrame(); 185public override DataFrame First(params string[] columnNames) 187DataFrame ret = new DataFrame(); 227public override DataFrame Head(int numberOfRows) 229DataFrame ret = new DataFrame(); 281public override DataFrame Tail(int numberOfRows) 283DataFrame ret = new DataFrame(); 335private DataFrameColumn ResizeAndInsertColumn(int columnIndex, long rowIndex, bool firstGroup, DataFrame ret, PrimitiveDataFrameColumn<long> empty, Func<string, DataFrameColumn> getColumn = null) 355public override DataFrame Max(params string[] columnNames) 357DataFrame ret = new DataFrame(); 383public override DataFrame Min(params string[] columnNames) 385DataFrame ret = new DataFrame(); 411public override DataFrame Product(params string[] columnNames) 413DataFrame ret = new DataFrame(); 439public override DataFrame Sum(params string[] columnNames) 441DataFrame ret = new DataFrame(); 467public override DataFrame Mean(params string[] columnNames) 469DataFrame ret = new DataFrame();
IDataView.Extension.cs (11)
17/// Returns a <see cref="Microsoft.Data.Analysis.DataFrame"/> from this <paramref name="dataView"/>. 20/// <param name="maxRows">The max number or rows in the <see cref="Microsoft.Data.Analysis.DataFrame"/>. Defaults to 100. Use -1 to construct a DataFrame using all the rows in <paramref name="dataView"/>.</param> 21/// <returns>A <see cref="Microsoft.Data.Analysis.DataFrame"/> with <paramref name="maxRows"/>.</returns> 22public static DataFrame ToDataFrame(this IDataView dataView, long maxRows = defaultMaxRows) 28/// Returns a <see cref="Microsoft.Data.Analysis.DataFrame"/> with the first 100 rows of this <paramref name="dataView"/>. 32/// <returns>A <see cref="Microsoft.Data.Analysis.DataFrame"/> with the selected columns and 100 rows.</returns> 33public static DataFrame ToDataFrame(this IDataView dataView, params string[] selectColumns) 39/// Returns a <see cref="Microsoft.Data.Analysis.DataFrame"/> with the first <paramref name="maxRows"/> of this <paramref name="dataView"/>. 42/// <param name="maxRows">The max number or rows in the <see cref="Microsoft.Data.Analysis.DataFrame"/>. Use -1 to construct a DataFrame using all the rows in <paramref name="dataView"/>.</param> 44/// <returns>A <see cref="Microsoft.Data.Analysis.DataFrame"/> with the selected columns and <paramref name="maxRows"/> rows.</returns> 45public static DataFrame ToDataFrame(this IDataView dataView, long maxRows, params string[] selectColumns)
PrimitiveDataFrameColumn.cs (2)
381public override DataFrame ValueCounts() 607public override GroupBy GroupBy(int columnIndex, DataFrame parent)
Microsoft.Data.Analysis.Interactive (3)
DataFrameKernelExtension.cs (1)
37Formatter.Register<DataFrame>((df, writer) =>
TabularDataResourceExtensions.cs (2)
15public static DataFrame ToDataFrame(this TabularDataResource tabularDataResource) 22var dataFrame = new DataFrame();
Microsoft.Data.Analysis.Interactive.Tests (6)
DataFrameInteractiveTests.cs (6)
20public static DataFrame MakeDataFrameWithTwoColumns(int length, bool withNulls = true) 29DataFrame dataFrame = new DataFrame(); 38DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 5); 49DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 26); 60DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 5); 91var dataFrame = tableData.ToDataFrame();
Microsoft.Data.Analysis.Tests (386)
ArrowIntegrationTests.cs (12)
61DataFrame df = DataFrame.FromArrowRecordBatch(originalBatch); 127DataFrame df = DataFrame.FromArrowRecordBatch(recordBatch); 146DataFrame df = new DataFrame(new List<DataFrameColumn>() { ageColumn, lengthColumn, stringColumn }); 176DataFrame df = DataFrame.FromArrowRecordBatch(originalBatch); 198DataFrame df = DataFrame.FromArrowRecordBatch(originalBatch); 216DataFrame emptyDataFrame = DataFrame.FromArrowRecordBatch(batch1); 235Assert.ThrowsAny<ArgumentException>(() => DataFrame.FromArrowRecordBatch(originalBatch));
DataFrame.IOTests.cs (154)
31internal static void VerifyColumnTypes(DataFrame df, bool testArrowStringColumn = false) 141var dataFrame = DataFrame.LoadCsvFromString(csv, separator: ',', header: true, 160void RegularTest(DataFrame df) 167DataFrame df = DataFrame.LoadCsv(GetStream(data)); 169DataFrame csvDf = DataFrame.LoadCsvFromString(data); 172void ReducedRowsTest(DataFrame reducedRows) 179DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), numberOfRowsToRead: 3); 181csvDf = DataFrame.LoadCsvFromString(data, numberOfRowsToRead: 3); 194void RegularTest(DataFrame df) 213DataFrame df = DataFrame.LoadCsv(GetStream(data), separator: ';', cultureInfo: cultureInfo); 217DataFrame csvDf = DataFrame.LoadCsvFromString(data, separator: ';', cultureInfo: cultureInfo); 231Assert.Throws<System.ArgumentException>(() => DataFrame.LoadCsv(GetStream(data))); 244DataFrame df = DataFrame.LoadCsv(GetStream(data), renameDuplicatedColumns: true); 273void RegularTest(DataFrame df) 281DataFrame df = DataFrame.LoadCsv(GetStream(data), header: false); 283DataFrame csvDf = DataFrame.LoadCsvFromString(data, header: false); 286void ReducedRowsTest(DataFrame reducedRows) 294DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), header: false, numberOfRowsToRead: 3); 296csvDf = DataFrame.LoadCsvFromString(data, header: false, numberOfRowsToRead: 3); 312void RegularTest(DataFrame df) 320DataFrame df = DataFrame.LoadCsv(GetStream(data), header: false); 322DataFrame csvDf = DataFrame.LoadCsvFromString(data, header: false); 325void ReducedRowsTest(DataFrame reducedRows) 333DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), header: false, numberOfRowsToRead: 3); 335csvDf = DataFrame.LoadCsvFromString(data, header: false, numberOfRowsToRead: 3); 339void VerifyDataFrameWithNamedColumnsAndDataTypes(DataFrame df, bool verifyColumnDataType, bool verifyNames) 404DataFrame df = DataFrame.LoadCsv(GetStream(data), 410DataFrame csvDf = DataFrame.LoadCsvFromString(data, 419df = DataFrame.LoadCsv(GetStream(data), 424csvDf = DataFrame.LoadCsvFromString(data, 431Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsv(GetStream(data), 435Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsvFromString(data, 452void Verify(DataFrame df) 495DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) }); 497df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) }); 511void Verify(DataFrame df, bool verifyDataTypes) 567DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double), typeof(DateTime) }); 569df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double), typeof(DateTime) }); 572df = DataFrame.LoadCsv(GetStream(data)); 574df = DataFrame.LoadCsvFromString(data); 588void Verify(DataFrame df) 595DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), separator: '|', numberOfRowsToRead: 3); 611DataFrame df = DataFrame.LoadCsv(GetStream(data), separator: '|'); 613df = DataFrame.LoadCsvFromString(data, separator: '|'); 627void Verify(DataFrame df) 634DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), separator: ';', numberOfRowsToRead: 3); 650DataFrame df = DataFrame.LoadCsv(GetStream(data), separator: ';'); 652df = DataFrame.LoadCsvFromString(data, separator: ';'); 665void Verify(DataFrame df) 672DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), numberOfRowsToRead: 3); 679DataFrame df = DataFrame.LoadCsv(GetStream(data)); 681df = DataFrame.LoadCsvFromString(data); 694var df = DataFrame.LoadCsvFromString(data, header: true); 709var df = DataFrame.LoadCsvFromString(data, header: true, columnNames: new[] { "vendor_id", "rate_code", "passenger_count", "trip_time_in_secs", "Column0", "Column1", "Column2", "Column3" }); 724var exp = Assert.ThrowsAny<ArgumentException>(() => DataFrame.LoadCsvFromString(data, header: true)); 732var dataFrame = DataFrame.LoadCsvFromString("11\r\n22\r\n33", header: false, addIndexColumn: true); 751Assert.Throws<IndexOutOfRangeException>(() => DataFrame.LoadCsv(GetStream(data))); 752Assert.Throws<IndexOutOfRangeException>(() => DataFrame.LoadCsvFromString(data)); 764void Verify(DataFrame df) 771DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), numberOfRowsToRead: 3); 778DataFrame df = DataFrame.LoadCsv(GetStream(data)); 780df = DataFrame.LoadCsvFromString(data); 795void Verify(DataFrame df) 821DataFrame df = DataFrame.LoadCsv(GetStream(data)); 823df = DataFrame.LoadCsvFromString(data); 838void Verify(DataFrame df) 883DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long) }); 885df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long) }); 900void Verify(DataFrame df) 945DataFrame df = DataFrame.LoadCsv(GetStream(data)); 947df = DataFrame.LoadCsvFromString(data); 962DataFrame dataFrame = new DataFrame(vBufferColumn); 966DataFrame.SaveCsv(dataFrame, csvStream); 969DataFrame readIn = DataFrame.LoadCsv(csvStream); 984DataFrame dataFrame = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, true); 986DataFrame.SaveCsv(dataFrame, csvStream); 989DataFrame readIn = DataFrame.LoadCsv(csvStream); 1009DataFrame dataFrame = DataFrameTests.MakeDataFrameWithNumericColumns(10, true); 1017DataFrame.SaveCsv(dataFrame, csvStream, separator: separator, cultureInfo: cultureInfo); 1020DataFrame readIn = DataFrame.LoadCsv(csvStream, separator: separator); 1044DataFrame dataFrame = DataFrameTests.MakeDataFrameWithNumericColumns(10, true); 1050DataFrame.SaveCsv(dataFrame, csvStream, cultureInfo: cultureInfo); 1053DataFrame readIn = DataFrame.LoadCsv(csvStream); 1074DataFrame dataFrame = DataFrameTests.MakeDataFrameWithNumericColumns(10, true); 1079Assert.Throws<ArgumentException>(() => DataFrame.SaveCsv(dataFrame, csvStream, separator: separator, cultureInfo: cultureInfo)); 1086DataFrame dataFrame = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, true); 1088DataFrame.SaveCsv(dataFrame, csvStream, header: false); 1091DataFrame readIn = DataFrame.LoadCsv(csvStream, header: false); 1112DataFrame dataFrame = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, true); 1115DataFrame.SaveCsv(dataFrame, csvStream, separator: separator); 1118DataFrame readIn = DataFrame.LoadCsv(csvStream, separator: separator); 1146DataFrame df = DataFrame.LoadCsv(GetStream(data)); 1179var dataFrame = DataFrame.LoadFrom(vals, columns); 1187var dataFrame = DataFrame.LoadFrom(vals, columns); 1202var dataFrame = DataFrame.LoadFrom(vals, columns); 1214var resDataFrame = await DataFrame.LoadFrom(dataAdapter); 1226static void AssertEqual(DataFrame dataFrame, (string name, Type type)[] columns, object[][] vals) 1306public void VerifyLoadCsv(DataFrame df) 1514DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: dataTypes, separator: separator); 1522DataFrame df = DataFrame.LoadCsvFromString(data, dataTypes: dataTypes, separator: separator); 1530DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: dataTypes, separator: separator); 1533DataFrame.SaveCsv(df, csvStream, separator: separator); 1538DataFrame df2 = DataFrame.LoadCsv(csvStream, dataTypes: dataTypes, separator: separator); 1673DataFrame defaultDf = DataFrame.LoadCsvFromString(csvString); 1677DataFrame customDf = DataFrame.LoadCsvFromString(csvString, guessTypeFunction: CustomGuessTypeFunction); 1695Assert.Throws<FormatException>(() => DataFrame.LoadCsvFromString(csvString));
DataFrameGroupByTests.cs (6)
27DataFrame df = MakeTestDataFrameWithParityAndTensColumns(length); 50var df = MakeTestDataFrameWithParityAndTensColumns(0); 68DataFrame df = MakeTestDataFrameWithParityAndTensColumns(length); 103DataFrame df = MakeTestDataFrameWithParityAndTensColumns(1); 110private DataFrame MakeTestDataFrameWithParityAndTensColumns(int length) 112DataFrame df = DataFrameTests.MakeDataFrameWithNumericColumns(length, false);
DataFrameIDataViewTests.cs (15)
105DataFrame df = DataFrameTests.MakeDataFrameWithAllMutableColumnTypes(10, withNulls: false); 259DataFrame df = DataFrameTests.MakeDataFrameWithAllMutableAndArrowColumnTypes(10, withNulls: false); 262DataFrame newDf = dfAsIDataView.ToDataFrame(); 274DataFrame df = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, withNulls: false); 276DataFrame newDf = dfAsIDataView.ToDataFrame("Int", "Double"); 289DataFrame df = DataFrameTests.MakeDataFrameWithAllColumnTypes(dataFrameSize, withNulls: false); 293DataFrame newDf; 327DataFrame df = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, withNulls: false); 329DataFrame newDf = dfAsIDataView.ToDataFrame(5, "Int", "Double"); 369private void VerifyDataFrameColumnAndDataViewColumnValues<T>(string columnName, IDataView data, DataFrame df, int maxRows = -1) 387DataFrame df = data.ToDataFrame(); 404DataFrame df = data.ToDataFrame("Name", "Value"); 422DataFrame df = data.ToDataFrame(maxRows); 439DataFrame df = data.ToDataFrame(3, "Name", "Value"); 489var df = data.ToDataFrame();
DataFrameTests.BinaryOperations.cs (18)
26DataFrame df = MakeDataFrameWithTwoColumns(12); 30var ret = df.Add(5); 97var df1 = MakeDataFrameWithNumericColumns(length); 98var df2 = MakeDataFrameWithNumericColumns(length); 149DataFrame df = DataFrameTests.MakeDataFrameWithTwoColumns(10); 152DataFrame dfd = df.Add(5.0f); 157DataFrame dfm = df.Add(5.0m); 173var df = new DataFrame(); 186var newdf = df.And(true); 188var newdf1 = df.And(listOfBools); 205var df = new DataFrame(); 247var df = new DataFrame(); 303var df = new DataFrame(); 361var df = MakeDataFrameWithNumericColumns(10); 363DataFrame tempDf = df + 1; 416var plusOne = df + 1; 419var plusDecimal = df + 1.1m; 447DataFrame df = MakeDataFrameWithNumericAndBoolColumns(10, withNulls: false);
DataFrameTests.Computations.cs (5)
21DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); 183DataFrame df = MakeDataFrameWithNumericStringAndDateTimeColumns(10); 422DataFrame df = MakeDataFrameWithNumericColumns(length, withNulls: false, startingFrom); 484var dfTest = new DataFrame(col1, col2); 501var dfTest = new DataFrame(col1, col2);
DataFrameTests.cs (84)
22DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 10); 29var headList = dataFrame.Head(5); 32var tailList = dataFrame.Tail(5); 51var df = DataFrame.LoadCsvFromString("a1,a2\n1,2\n3,4"); 65DataFrame dataFrame = new DataFrame(); 108DataFrame dataFrame1 = new DataFrame(intColumn, floatColumn); 117DataFrame dataFrame = MakeDataFrameWithAllMutableColumnTypes(10); 151DataFrame dataFrame = new DataFrame(); 167DataFrame dataFrame = MakeDataFrameWithAllMutableColumnTypes(10); 185DataFrame dataframe = new DataFrame(city, temp); 204DataFrame dataframe = new DataFrame(city, temp); 229DataFrame df = MakeDataFrameWithTwoColumns(10); 238DataFrame df = MakeDataFrameWithAllMutableColumnTypes(20); 244var sortedDf = df.OrderBy("Int"); 301DataFrame df = MakeDataFrameWithNumericAndBoolColumns(10); 302DataFrame count = df.GroupBy("Bool").Count(); 314DataFrame first = df.GroupBy("Bool").First(); 326DataFrame head = df.GroupBy("Bool").Head(3); 347DataFrame tail = df.GroupBy("Bool").Tail(3); 361DataFrame max = df.GroupBy("Bool").Max(); 375DataFrame min = df.GroupBy("Bool").Min(); 378DataFrame product = df.GroupBy("Bool").Product(); 381DataFrame sum = df.GroupBy("Bool").Sum(); 384DataFrame mean = df.GroupBy("Bool").Mean(); 404DataFrame columnSum = df.GroupBy("Bool").Sum("Int"); 408DataFrame columnMax = df.GroupBy("Bool").Max("Int"); 412DataFrame columnProduct = df.GroupBy("Bool").Product("Int"); 416DataFrame columnMin = df.GroupBy("Bool").Min("Int"); 421DataFrame countIntColumn = df.GroupBy("Bool").Count("Int"); 427DataFrame firstDecimalColumn = df.GroupBy("Bool").First("Decimal"); 437void GroupCountAndAssert(DataFrame frame) 439DataFrame grouped = frame.GroupBy("Column1").Count(); 443DataFrame df = MakeDataFrame<byte, bool>(10, false); 483DataFrame df = MakeDataFrameWithAllColumnTypes(10); 562DataFrame df = MakeDataFrameWithNumericColumns(10); 603DataFrame df = MakeDataFrameWithAllColumnTypes(10); 606void VerifyDataFrameClamp(DataFrame clampedColumn) 642DataFrame clamped = df.Clamp(3, 7); 661DataFrame df = MakeDataFrameWithAllColumnTypes(10); 664DataFrame prefix = df.AddPrefix("Prefix_"); 683DataFrame suffix = df.AddSuffix("_Suffix"); 706DataFrame df = MakeDataFrameWithAllColumnTypes(10); 707DataFrame sampled = df.Sample(7); 726DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); 728DataFrame description = df.Description(); 759DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); 769DataFrame Info = df.Info(); 787DataFrame df = MakeDataFrameWithAllMutableColumnTypes(20); 790DataFrame anyNulls = df.DropNulls(); 793DataFrame allNulls = df.DropNulls(DropNullOptions.All); 800DataFrame df = new DataFrame(); 812DataFrame df = MakeDataFrameWithTwoColumns(20); 814DataFrame fillNulls = df.FillNulls(1000); 860DataFrame df = MakeDataFrameWithAllColumnTypes(10, withNulls: false); 861DataFrame valueCounts = df.Columns["Bool"].ValueCounts(); 871DataFrame df = MakeDataFrameWithTwoColumns(10); 915DataFrame df = MakeDataFrameWithAllColumnTypes(dfLength, withNulls: true); 916DataFrame intDf = MakeDataFrameWithTwoColumns(intDfLength, false); 918DataFrame clone = df[intColumn]; 935DataFrame df = MakeDataFrameWithAllColumnTypes(10); 949DataFrame df = MakeDataFrameWithAllColumnTypes(10); 963DataFrame df = MakeDataFrameWithAllColumnTypes(10); 994DataFrame df = MakeDataFrameWithNumericColumns(10); 1018DataFrame df = MakeDataFrame<float, bool>(10); 1019DataFrame df2 = MakeDataFrame<int, bool>(5); 1024DataFrame ret = df.Append(df2.Rows, inPlace: false); 1031void Verify(DataFrame ret, DataFrame check1, DataFrame check2) 1053DataFrame dfClone = df.Clone(); 1061var dataFrame = new DataFrame( 1067var dataFrame2 = new DataFrame( 1072var resultDataFrame = dataFrame.Append(dataFrame2.Rows); 1090DataFrame df = MakeDataFrame<int, bool>(10); 1096DataFrame ret = df.Append(new List<object> { 5, true }); 1198DataFrame df = MakeDataFrame<int, bool>(10); 1279DataFrame dataFrame = MakeDataFrameWithAllColumnTypes(10); 1349DataFrame df = MakeDataFrameWithNumericColumns(10, true, 0); 1357DataFrame df = MakeDataFrameWithNumericColumns(10, true, 0); 1366var dfTest = new DataFrame(col); 1368var filteredNullDf = dfTest.Filter(dfTest["col"].ElementwiseNotEquals(null)); 1383var dfTest = new DataFrame(index, col); 1385var filteredNullDf = dfTest.Filter(dfTest["col"].ElementwiseEquals(null));
DataFrameTests.Filter.cs (6)
19DataFrame df = MakeDataFrameWithNumericColumns(10); 31DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); 32DataFrame boolColumnFiltered = df[df.Columns["Bool"].ElementwiseEquals(true)]; 45DataFrame intEnumerableFiltered = df[Enumerable.Range(0, 10)]; 46DataFrame boolEnumerableFiltered = df[Enumerable.Range(0, 10).Select(x => true)]; 47DataFrame longEnumerableFiltered = df[Enumerable.Range(0, 10).Select(x => (long)x)];
DataFrameTests.Join.cs (6)
19DataFrame left = MakeDataFrameWithAllMutableColumnTypes(10); 20DataFrame right = MakeDataFrameWithAllMutableColumnTypes(5); 24DataFrame join = left.Join(right); 85private void VerifyJoin(DataFrame join, DataFrame left, DataFrame right, JoinAlgorithm joinAlgorithm)
DataFrameTests.Merge.cs (48)
21DataFrame left = MakeDataFrameWithNumericColumns(leftCount, false); 25DataFrame right = MakeDataFrameWithNumericColumns(rightCount, false); 29DataFrame merge = left.Merge<int>(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.Inner); 38DataFrame left = MakeDataFrameWithAllMutableColumnTypes(10); 39DataFrame right = MakeDataFrameWithAllMutableColumnTypes(5); 43DataFrame merge = left.Merge<int>(right, "Int", "Int"); 106private void MatchRowsOnMergedDataFrame(DataFrame merge, DataFrame left, DataFrame right, long mergeRow, long? leftRow, long? rightRow) 139DataFrame left = MakeDataFrameWithAllMutableColumnTypes(leftLength); 144DataFrame right = MakeDataFrameWithAllMutableColumnTypes(rightLength); 150DataFrame merge = left.Merge<int>(right, "Int", "Int", joinAlgorithm: joinAlgorithm); 178DataFrame left = MakeDataFrameWithAllMutableColumnTypes(5); 179DataFrame right = MakeDataFrameWithAllMutableColumnTypes(10); 208DataFrame merge = left.Merge<int>(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.Inner); 227DataFrame left = MakeDataFrameWithAllMutableColumnTypes(5); 229DataFrame right = MakeDataFrameWithAllMutableColumnTypes(5); 258DataFrame merge = left.Merge<int>(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.FullOuter); 298var left = new DataFrame(); 303var right = new DataFrame(); 335var merge = left.Merge(right, new[] { "G1", "G2" }, new[] { "G1", "G2" }); 364var left = new DataFrame(); 369var right = new DataFrame(); 396var merge = left.Merge(right, new[] { "G1", "G2" }, new[] { "G1", "G2" }); 422var left = new DataFrame(); 427var right = new DataFrame(); 454var merge = left.Merge(right, new[] { "G1", "G2" }, new[] { "G1", "G2" }, joinAlgorithm: JoinAlgorithm.Right); 480var left = new DataFrame(); 485var right = new DataFrame(); 511var merge = left.Merge(right, new[] { "G1", "G2" }, new[] { "G1", "G2" }, joinAlgorithm: JoinAlgorithm.Inner); 536var left = new DataFrame(); 541var right = new DataFrame(); 569var merge = left.Merge(right, new[] { "G1", "G2" }, new[] { "G1", "G2" }, joinAlgorithm: JoinAlgorithm.FullOuter); 596var left = new DataFrame(); 602var right = new DataFrame(); 628var merge = left.Merge(right, new[] { "G1", "G2", "G3" }, new[] { "G1", "G2", "G3" }); 652var left = new DataFrame(); 658var right = new DataFrame(); 684var merge = left.Merge(right, new[] { "G1", "G2", "G3" }, new[] { "G1", "G2", "G3" }, joinAlgorithm: JoinAlgorithm.Right); 705DataFrame left = MakeDataFrameWithAllMutableColumnTypes(2, false); 706DataFrame right = MakeDataFrameWithAllMutableColumnTypes(1); 708DataFrame merge = left.Merge<int>(right, "Int", "Int"); 721DataFrame left = MakeDataFrameWithAllMutableColumnTypes(2, false); 722DataFrame right = MakeDataFrameWithAllMutableColumnTypes(1); 724DataFrame merge = left.Merge<int>(right, "Int", "Int"); 766private void VerifyMerge(DataFrame merge, DataFrame left, DataFrame right, JoinAlgorithm joinAlgorithm)
DataFrameTests.Sort.cs (7)
19DataFrame df = MakeDataFrameWithAllMutableColumnTypes(20); 23DataFrame dfTest; 24DataFrame dfTrain = SplitTrainTest(df, 0.8f, out dfTest); 27var sortedDf = dfTrain.OrderBy("Int"); 105DataFrame dataFrame = MakeDataFrameWithAllMutableColumnTypes(10); 108DataFrame sorted = dataFrame.OrderBy("Int"); 109void Verify(DataFrame sortedDataFrame)
DataFrameTests.Utils.cs (21)
17public static DataFrame MakeDataFrameWithTwoColumns(int length, bool withNulls = true) 26DataFrame dataFrame = new DataFrame(); 83public static DataFrame MakeDataFrameWithAllColumnTypes(int length, bool withNulls = true) 85DataFrame df = MakeDataFrameWithAllMutableAndArrowColumnTypes(length, withNulls); 93public static DataFrame MakeDataFrameWithAllMutableAndArrowColumnTypes(int length, bool withNulls = true) 95DataFrame df = MakeDataFrameWithAllMutableColumnTypes(length, withNulls); 102public static DataFrame MakeDataFrameWithAllMutableColumnTypes(int length, bool withNulls = true) 104DataFrame df = MakeDataFrameWithNumericStringAndDateTimeColumns(length, withNulls); 114public static DataFrame MakeDataFrameWithNumericAndBoolColumns(int length, bool withNulls = true) 116DataFrame df = MakeDataFrameWithNumericColumns(length, withNulls); 126public static DataFrame MakeDataFrameWithNumericAndStringColumns(int length, bool withNulls = true) 128DataFrame df = MakeDataFrameWithNumericColumns(length, withNulls); 146public static DataFrame MakeDataFrameWithNumericStringAndDateTimeColumns(int length, bool withNulls = true) 148DataFrame df = MakeDataFrameWithNumericAndStringColumns(length, withNulls); 159public static DataFrame MakeDataFrameWithNumericColumns(int length, bool withNulls = true, int startingFrom = 0) 190var dataFrame = new DataFrame(columnsList); 203public static DataFrame MakeDataFrame<T1, T2>(int length, bool withNulls = true) 209DataFrame dataFrame = new DataFrame(new List<DataFrameColumn> { baseColumn1, baseColumn2 }); 222public DataFrame SplitTrainTest(DataFrame input, float testRatio, out DataFrame Test)
PrimitiveDataFrameColumnTests.cs (4)
499var dfTest = new DataFrame(col); 501var filteredNullDf = dfTest.Filter(dfTest["col"].ElementwiseNotEquals(null)); 516var dfTest = new DataFrame(index, col); 518var filteredNullDf = dfTest.Filter(dfTest["col"].ElementwiseEquals(null));
Microsoft.ML.AutoML.Interactive (2)
AutoMLMonitorKernelExtension.cs (1)
101Formatter.GetPreferredFormatterFor(typeof(DataFrame), "text/html").Format(notebookMonitor.TrialData, writer);
NotebookMonitor.cs (1)
25public DataFrame TrialData { get; set; }
Microsoft.ML.Fairlearn (20)
Metrics\FairlearnMetricCatalog.cs (7)
76public DataFrame ByGroup() 99DataFrame result = new DataFrame(); 168public DataFrame ByGroup() 185var evalDf = _eval.ToDataFrame(); 190var data = new DataFrame(_eval.Schema.AsEnumerable().Select<DataViewSchema.Column, DataFrameColumn>(column => 233DataFrame result = new DataFrame(); 245DataFrame groupMetrics = ByGroup();
Metrics\GroupMetric.cs (1)
24DataFrame ByGroup();
Reductions\GridSearchTrialRunner.cs (2)
72var df = new DataFrame(); 87var gamma = _moment.Gamma(column);
Reductions\Moment.cs (3)
25public DataFrame Tags { get; private set; } 66public abstract DataFrame Gamma(PrimitiveDataFrameColumn<float> yPred); 72public abstract DataFrameColumn SignedWeights(DataFrame lambdaVec);
Reductions\UtilityParity.cs (7)
91public override DataFrame Gamma(PrimitiveDataFrameColumn<float> yPred/* Maybe change this to a predictor (func)*/) 114DataFrame gSigned = new DataFrame(posSign, groupID, upperBoundDiff); 121DataFrame dfNeg = new DataFrame(negSign, groupID, lowerBoundDiff); 135public override DataFrameColumn SignedWeights(DataFrame lambdaVec) 141var gPos = lambdaVec.Filter(lambdaVec["sign"].ElementwiseEquals("+")).OrderBy("group_id"); 142var gNeg = lambdaVec.Filter(lambdaVec["sign"].ElementwiseEquals("-")).OrderBy("group_id"); 147DataFrame lookUp = new DataFrame(gPos["group_id"], adjust);
Microsoft.ML.Fairlearn.Tests (11)
GridSearchTest.cs (6)
28var X = CreateDummyDataset(); 36private DataFrame CreateDummyDataset() 38var df = new DataFrame(); 48private DataFrame CreateGridSearchDataset() 62var df = new DataFrame(); 92var df = CreateGridSearchDataset();
MetricTest.cs (3)
40var metricByGroup = regressionMetric.ByGroup(); 69DataFrame df = new DataFrame(label, groupId, pred, score, prob); 72var metricByGroup = metrics.ByGroup();
UtilityTest.cs (2)
27DataFrame x = new DataFrame(); 32var gSinged = dp.Gamma(ypred);
Microsoft.ML.TorchSharp.Tests (2)
TextClassificationTests.cs (2)
174var df = DataFrame.LoadCsv(GetDataPath("github-issues-train.tsv"), separator: '\t', header: true, columnNames: new[] { "ID", "Label", "Title", "Description" });