1 write to
Microsoft.Data.Analysis (1)
DataFrame.cs (1)
162
set => Columns
[
columnName] = value;
432 references to
Microsoft.Data.Analysis (29)
DataFrame.cs (2)
161
get => Columns
[
columnName];
680
DataFrameColumn column = Columns
[
columnName];
DataFrame.Join.cs (4)
204
DataFrameColumn shrinkedRetainedColumn = retainedDataFrame.Columns
[
retainedJoinColumnNames[colNameIndex]];
228
DataFrameColumn supplementaryColumn = supplementaryDataFrame.Columns
[
supplemetaryJoinColumnNames[colNameIndex]];
285
var retainJoinColumns = retainedJoinColumnNames.Select(name => retainedDataFrame.Columns
[
name]).ToArray();
390
var columns = supplementaryJoinColumns.Select(name => supplementaryDataFrame.Columns
[
name]).ToArray();
DataFrameColumnCollection.cs (18)
43
var column = this
[
currentName];
217
DataFrameColumn column = this
[
name];
234
DataFrameColumn column = this
[
name];
251
DataFrameColumn column = this
[
name];
268
DataFrameColumn column = this
[
name];
285
DataFrameColumn column = this
[
name];
302
DataFrameColumn column = this
[
name];
319
DataFrameColumn column = this
[
name];
336
DataFrameColumn column = this
[
name];
353
DataFrameColumn column = this
[
name];
370
DataFrameColumn column = this
[
name];
387
DataFrameColumn column = this
[
name];
404
DataFrameColumn column = this
[
name];
421
DataFrameColumn column = this
[
name];
438
DataFrameColumn column = this
[
name];
455
DataFrameColumn column = this
[
name];
472
DataFrameColumn column = this
[
name];
489
DataFrameColumn column = this
[
name];
GroupBy.cs (5)
173
retColumn = ret.Columns
[
column.Name];
214
retColumn = ret.Columns
[
column.Name];
259
retColumn = ret.Columns
[
column.Name];
315
retColumn = ret.Columns
[
column.Name];
349
retColumn = ret.Columns
[
column.Name];
Microsoft.Data.Analysis.Tests (403)
ArrowIntegrationTests.cs (17)
166
Assert.Equal(1, df.Columns
[
"Column1"][1]);
167
df.Columns
[
"Column1"][1] = 100;
168
Assert.Equal(100, df.Columns
[
"Column1"][1]);
169
Assert.Equal(0, df.Columns
[
"Column1"].NullCount);
188
Assert.Equal(0, df.Columns
[
"EmptyNullBitMapColumn"].NullCount);
189
Assert.Equal(10, df.Columns
[
"EmptyNullBitMapColumn"].Length);
190
df.Columns
[
"EmptyNullBitMapColumn"][9] = null;
191
Assert.Equal(1, df.Columns
[
"EmptyNullBitMapColumn"].NullCount);
192
Assert.Equal(10, df.Columns
[
"EmptyDataColumn"].NullCount);
193
Assert.Equal(10, df.Columns
[
"EmptyDataColumn"].Length);
194
df.Columns
[
"EmptyDataColumn"][9] = 9;
195
Assert.Equal(9, df.Columns
[
"EmptyDataColumn"].NullCount);
196
Assert.Equal(10, df.Columns
[
"EmptyDataColumn"].Length);
199
Assert.Equal(i, (int)df.Columns
[
"EmptyNullBitMapColumn"][i]);
200
Assert.Null(df.Columns
[
"EmptyDataColumn"][i]);
207
Assert.Equal(0, emptyDataFrame.Columns
[
"EmptyDataAndNullColumns"].Length);
208
Assert.Equal(0, emptyDataFrame.Columns
[
"EmptyDataAndNullColumns"].NullCount);
DataFrame.IOTests.cs (19)
158
Assert.Equal(verifyCMT, df.Columns
[
"vendor_id"][3]);
170
Assert.Equal(verifyCMT, reducedRows.Columns
[
"vendor_id"][2]);
242
Assert.Equal("CMT", df.Columns
[
"vendor_id"][3]);
248
Assert.Equal("CRD", df.Columns
[
"payment_type"][0]);
249
Assert.Equal("CRD_1", df.Columns
[
"payment_type.1"][0]);
250
Assert.Equal("Test", df.Columns
[
"payment_type.2"][0]);
271
Assert.Equal(verifyCMT, df.Columns
[
"Column0"][3]);
284
Assert.Equal(verifyCMT, reducedRows.Columns
[
"Column0"][2]);
310
Assert.Equal(verifyCMT, df.Columns
[
"Column0"][3]);
323
Assert.Equal(verifyCMT, reducedRows.Columns
[
"Column0"][2]);
553
var dateTimeColumn = df.Columns
[
"date"];
586
Assert.Equal("CMT", df.Columns
[
"vendor_id"][4]);
592
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
625
Assert.Equal("CMT", df.Columns
[
"vendor_id"][4]);
631
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
663
Assert.Equal("CMT", df.Columns
[
"vendor_id"][3]);
669
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
762
Assert.Equal("CMT", df.Columns
[
"vendor_id"][3]);
768
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
DataFrameIDataViewTests.cs (9)
273
Assert.True(df.Columns
[
"Int"].ElementwiseEquals(newDf.Columns
[
"Int"]).All());
274
Assert.True(df.Columns
[
"Double"].ElementwiseEquals(newDf.Columns
[
"Double"]).All());
332
Assert.Equal(df.Columns
[
"Int"][r], newDf.Columns
[
"Int"][r]);
333
Assert.Equal(df.Columns
[
"Double"][r], newDf.Columns
[
"Double"][r]);
373
Assert.Equal(value, df.Columns
[
columnName][cc++]);
DataFrameTests.BinaryOperations.cs (30)
98
newColumn = df1.Columns
[
df1.Columns[i].Name] + df2.Columns
[
df2.Columns[i].Name];
102
newColumn = df1.Columns
[
df1.Columns[i].Name] - df2.Columns
[
df2.Columns[i].Name];
106
newColumn = df1.Columns
[
df1.Columns[i].Name] * df2.Columns
[
df2.Columns[i].Name];
120
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseEquals(df2.Columns
[
df2.Columns[i].Name]);
123
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseNotEquals(df2.Columns
[
df2.Columns[i].Name]);
126
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseGreaterThanOrEqual(df2.Columns
[
df2.Columns[i].Name]);
129
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseLessThanOrEqual(df2.Columns
[
df2.Columns[i].Name]);
132
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseGreaterThan(df2.Columns
[
df2.Columns[i].Name]);
135
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseLessThan(df2.Columns
[
df2.Columns[i].Name]);
363
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
369
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
375
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
381
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
387
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
395
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
401
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
407
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
416
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
422
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
442
Int32DataFrameColumn ints = df.Columns
[
"Int"] as Int32DataFrameColumn;
468
BooleanDataFrameColumn bools = df.Columns
[
"Bool"] as BooleanDataFrameColumn;
DataFrameTests.Computations.cs (141)
21
Assert.Equal(-10, df.Columns
[
"Int"][0]);
23
DataFrameColumn absColumn = df.Columns
[
"Int"].Abs();
25
Assert.Equal(-10, df.Columns
[
"Int"][0]);
26
df.Columns
[
"Int"].Abs(true);
27
Assert.Equal(10, df.Columns
[
"Int"][0]);
29
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].All());
30
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].Any());
31
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].All());
32
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].Any());
33
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].All());
34
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].Any());
35
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].All());
36
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].Any());
37
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].All());
38
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].Any());
39
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].All());
40
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].Any());
41
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].All());
42
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].Any());
43
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].All());
44
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].Any());
45
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].All());
46
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].Any());
47
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].All());
48
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].Any());
49
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].All());
50
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].Any());
51
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].All());
52
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].Any());
53
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].All());
54
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].Any());
56
bool any = df.Columns
[
"Bool"].Any();
57
bool all = df.Columns
[
"Bool"].All();
62
df.Columns
[
"Double"][0] = 100.0;
63
DataFrameColumn doubleColumn = df.Columns
[
"Double"].CumulativeMax();
71
Assert.Equal(1.0, df.Columns
[
"Double"][1]);
72
df.Columns
[
"Double"].CumulativeMax(true);
73
for (int i = 0; i < df.Columns
[
"Double"].Length; i++)
76
Assert.Null(df.Columns
[
"Double"][i]);
78
Assert.Equal(100.0, (double)df.Columns
[
"Double"][i]);
81
df.Columns
[
"Float"][0] = -10.0f;
82
DataFrameColumn floatColumn = df.Columns
[
"Float"].CumulativeMin();
90
Assert.Equal(9.0f, df.Columns
[
"Float"][9]);
91
df.Columns
[
"Float"].CumulativeMin(true);
92
for (int i = 0; i < df.Columns
[
"Float"].Length; i++)
95
Assert.Null(df.Columns
[
"Float"][i]);
97
Assert.Equal(-10.0f, (float)df.Columns
[
"Float"][i]);
100
DataFrameColumn uintColumn = df.Columns
[
"Uint"].CumulativeProduct();
102
Assert.Equal((uint)8, df.Columns
[
"Uint"][8]);
103
df.Columns
[
"Uint"].CumulativeProduct(true);
104
Assert.Equal((uint)0, df.Columns
[
"Uint"][9]);
106
DataFrameColumn ushortColumn = df.Columns
[
"Ushort"].CumulativeSum();
108
Assert.Equal((ushort)9, df.Columns
[
"Ushort"][9]);
109
df.Columns
[
"Ushort"].CumulativeSum(true);
110
Assert.Equal((ushort)40, df.Columns
[
"Ushort"][9]);
112
Assert.Equal(100.0, df.Columns
[
"Double"].Max());
113
Assert.Equal(-10.0f, df.Columns
[
"Float"].Min());
114
Assert.Equal((uint)0, df.Columns
[
"Uint"].Product());
115
Assert.Equal((ushort)130, df.Columns
[
"Ushort"].Sum());
117
df.Columns
[
"Double"][0] = 100.1;
118
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
119
DataFrameColumn roundColumn = df.Columns
[
"Double"].Round();
121
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
122
df.Columns
[
"Double"].Round(true);
123
Assert.Equal(100.0, df.Columns
[
"Double"][0]);
183
Assert.Equal(-10, df.Columns
[
"Int"][0]);
185
DataFrameColumn absColumn = df.Columns
[
"Int"].Abs();
187
Assert.Equal(-10, df.Columns
[
"Int"][0]);
188
df.Columns
[
"Int"].Abs(true);
189
Assert.Equal(10, df.Columns
[
"Int"][0]);
191
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].All());
192
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].Any());
193
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].All());
194
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].Any());
195
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].All());
196
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].Any());
197
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].All());
198
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].Any());
199
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].All());
200
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].Any());
201
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].All());
202
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].Any());
203
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].All());
204
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].Any());
205
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].All());
206
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].Any());
207
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].All());
208
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].Any());
209
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].All());
210
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].Any());
211
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].All());
212
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].Any());
213
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].All());
214
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].Any());
215
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].All());
216
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].Any());
220
df.Columns
[
"DateTime"][0] = maxDate;
221
DataFrameColumn dateTimeColumn = df.Columns
[
"DateTime"].CumulativeMax();
231
df.Columns
[
"Double"][0] = 100.0;
232
DataFrameColumn doubleColumn = df.Columns
[
"Double"].CumulativeMax();
240
Assert.Equal(1.0, df.Columns
[
"Double"][1]);
241
df.Columns
[
"Double"].CumulativeMax(true);
242
for (int i = 0; i < df.Columns
[
"Double"].Length; i++)
245
Assert.Null(df.Columns
[
"Double"][i]);
247
Assert.Equal(100.0, (double)df.Columns
[
"Double"][i]);
250
df.Columns
[
"Float"][0] = -10.0f;
251
DataFrameColumn floatColumn = df.Columns
[
"Float"].CumulativeMin();
259
Assert.Equal(9.0f, df.Columns
[
"Float"][9]);
260
df.Columns
[
"Float"].CumulativeMin(true);
261
for (int i = 0; i < df.Columns
[
"Float"].Length; i++)
264
Assert.Null(df.Columns
[
"Float"][i]);
266
Assert.Equal(-10.0f, (float)df.Columns
[
"Float"][i]);
269
DataFrameColumn uintColumn = df.Columns
[
"Uint"].CumulativeProduct();
271
Assert.Equal((uint)8, df.Columns
[
"Uint"][8]);
272
df.Columns
[
"Uint"].CumulativeProduct(true);
273
Assert.Equal((uint)0, df.Columns
[
"Uint"][9]);
275
DataFrameColumn ushortColumn = df.Columns
[
"Ushort"].CumulativeSum();
277
Assert.Equal((ushort)9, df.Columns
[
"Ushort"][9]);
278
df.Columns
[
"Ushort"].CumulativeSum(true);
279
Assert.Equal((ushort)40, df.Columns
[
"Ushort"][9]);
281
Assert.Equal(100.0, df.Columns
[
"Double"].Max());
282
Assert.Equal(-10.0f, df.Columns
[
"Float"].Min());
283
Assert.Equal((uint)0, df.Columns
[
"Uint"].Product());
284
Assert.Equal((ushort)130, df.Columns
[
"Ushort"].Sum());
286
df.Columns
[
"Double"][0] = 100.1;
287
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
288
DataFrameColumn roundColumn = df.Columns
[
"Double"].Round();
290
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
291
df.Columns
[
"Double"].Round(true);
292
Assert.Equal(100.0, df.Columns
[
"Double"][0]);
422
var byteColumn = (PrimitiveDataFrameColumn<byte>)df.Columns
[
"Byte"];
423
var decimalColumn = (PrimitiveDataFrameColumn<decimal>)df.Columns
[
"Decimal"];
424
var doubleColumn = (PrimitiveDataFrameColumn<double>)df.Columns
[
"Double"];
425
var floatColumn = (PrimitiveDataFrameColumn<float>)df.Columns
[
"Float"];
426
var intColumn = (PrimitiveDataFrameColumn<int>)df.Columns
[
"Int"];
427
var longColumn = (PrimitiveDataFrameColumn<long>)df.Columns
[
"Long"];
428
var sbyteColumn = (PrimitiveDataFrameColumn<sbyte>)df.Columns
[
"Sbyte"];
429
var shortColumn = (PrimitiveDataFrameColumn<short>)df.Columns
[
"Short"];
430
var uintColumn = (PrimitiveDataFrameColumn<uint>)df.Columns
[
"Uint"];
431
var ulongColumn = (PrimitiveDataFrameColumn<ulong>)df.Columns
[
"Ulong"];
432
var ushortColumn = (PrimitiveDataFrameColumn<ushort>)df.Columns
[
"Ushort"];
DataFrameTests.cs (120)
53
var dc = df.Columns
[
"a1"];
130
DataFrameColumn intColumn_1 = dataFrame.Columns
[
"NewIntColumn"];
134
DataFrameColumn lastColumn_1 = dataFrame.Columns
[
originalLastColumn.Name];
229
df["Int3"] = df.Columns
[
"Int1"] * 2 + df.Columns
[
"Int2"];
230
Assert.Equal(16, df.Columns
[
"Int3"][2]);
237
df.Columns
[
"Int"][0] = 100;
238
df.Columns
[
"Int"][19] = -1;
239
df.Columns
[
"Int"][5] = 2000;
243
Assert.Null(sortedDf.Columns
[
"Int"][19]);
244
Assert.Equal(-1, sortedDf.Columns
[
"Int"][0]);
245
Assert.Equal(100, sortedDf.Columns
[
"Int"][17]);
246
Assert.Equal(2000, sortedDf.Columns
[
"Int"][18]);
250
Assert.Null(sortedDf.Columns
[
"Int"][19]);
251
Assert.Equal(-1, sortedDf.Columns
[
"Int"][18]);
252
Assert.Equal(100, sortedDf.Columns
[
"Int"][1]);
253
Assert.Equal(2000, sortedDf.Columns
[
"Int"][0]);
257
Assert.Null(sortedDf.Columns
[
"Int"][0]);
258
Assert.Equal(-1, sortedDf.Columns
[
"Int"][1]);
259
Assert.Equal(100, sortedDf.Columns
[
"Int"][18]);
260
Assert.Equal(2000, sortedDf.Columns
[
"Int"][19]);
264
Assert.Null(sortedDf.Columns
[
"Int"][0]);
265
Assert.Equal(-1, sortedDf.Columns
[
"Int"][19]);
266
Assert.Equal(100, sortedDf.Columns
[
"Int"][2]);
267
Assert.Equal(2000, sortedDf.Columns
[
"Int"][1]);
271
Assert.Null(sortedDf.Columns
[
"Int"][19]);
272
Assert.Equal(1, sortedDf.Columns
[
"Int"][1]);
273
Assert.Equal(8, sortedDf.Columns
[
"Int"][17]);
274
Assert.Equal(9, sortedDf.Columns
[
"Int"][18]);
278
Assert.Null(sortedDf.Columns
[
"Int"][19]);
279
Assert.Equal(8, sortedDf.Columns
[
"Int"][1]);
280
Assert.Equal(9, sortedDf.Columns
[
"Int"][0]);
284
Assert.Null(sortedDf.Columns
[
"Int"][0]);
285
Assert.Equal(1, sortedDf.Columns
[
"Int"][2]);
286
Assert.Equal(8, sortedDf.Columns
[
"Int"][18]);
287
Assert.Equal(9, sortedDf.Columns
[
"Int"][19]);
291
Assert.Null(sortedDf.Columns
[
"Int"][0]);
292
Assert.Equal(8, sortedDf.Columns
[
"Int"][2]);
293
Assert.Equal(9, sortedDf.Columns
[
"Int"][1]);
302
Assert.Equal((long)5, count.Columns
[
"Int"][0]);
303
Assert.Equal((long)4, count.Columns
[
"Decimal"][1]);
319
DataFrameColumn firstColumn = first.Columns
[
originalColumn.Name];
331
DataFrameColumn headColumn = head.Columns
[
originalColumn.Name];
340
DataFrameColumn headColumn = head.Columns
[
originalColumn.Name];
354
DataFrameColumn tailColumn = tail.Columns
[
originalColumn.Name];
368
DataFrameColumn maxColumn = max.Columns
[
originalColumn.Name];
391
DataFrameColumn minColumn = min.Columns
[
originalColumn.Name];
394
DataFrameColumn productColumn = product.Columns
[
originalColumn.Name];
397
DataFrameColumn sumColumn = sum.Columns
[
originalColumn.Name];
404
Assert.Equal(20, columnSum.Columns
[
"Int"][0]);
405
Assert.Equal(20, columnSum.Columns
[
"Int"][1]);
408
Assert.Equal(8, columnMax.Columns
[
"Int"][0]);
409
Assert.Equal(9, columnMax.Columns
[
"Int"][1]);
412
Assert.Equal(0, columnProduct.Columns
[
"Int"][0]);
413
Assert.Equal(0, columnProduct.Columns
[
"Int"][1]);
416
Assert.Equal(0, columnMin.Columns
[
"Int"][0]);
417
Assert.Equal(1, columnMin.Columns
[
"Int"][1]);
422
Assert.Equal((long)5, countIntColumn.Columns
[
"Int"][0]);
423
Assert.Equal((long)4, countIntColumn.Columns
[
"Int"][1]);
428
Assert.Equal((decimal)0, firstDecimalColumn.Columns
[
"Decimal"][0]);
429
Assert.Equal((decimal)1, firstDecimalColumn.Columns
[
"Decimal"][1]);
496
StringDataFrameColumn stringColumn = (StringDataFrameColumn)df.Columns
[
"String"];
511
ArrowStringDataFrameColumn arrowStringColumn = (ArrowStringDataFrameColumn)df.Columns
[
"ArrowString"];
526
SingleDataFrameColumn floatColumn = (SingleDataFrameColumn)df.Columns
[
"Float"];
541
Int32DataFrameColumn intColumn = (Int32DataFrameColumn)df.Columns
[
"Int"];
562
DataFrameColumn clamped = df.Columns
[
"Int"].Clamp(3, 7);
564
Assert.Equal(0, df.Columns
[
"Int"][0]);
566
Assert.Equal(1, df.Columns
[
"Int"][1]);
568
Assert.Equal(2, df.Columns
[
"Int"][2]);
570
Assert.Equal(3, df.Columns
[
"Int"][3]);
572
Assert.Equal(4, df.Columns
[
"Int"][4]);
574
Assert.Null(df.Columns
[
"Int"][5]);
576
Assert.Equal(6, df.Columns
[
"Int"][6]);
578
Assert.Equal(7, df.Columns
[
"Int"][7]);
580
Assert.Equal(8, df.Columns
[
"Int"][8]);
582
Assert.Equal(9, df.Columns
[
"Int"][9]);
585
df.Columns
[
"Int"].Clamp(3, 7, true);
586
Assert.Equal(3, df.Columns
[
"Int"][0]);
587
Assert.Equal(3, df.Columns
[
"Int"][1]);
588
Assert.Equal(3, df.Columns
[
"Int"][2]);
589
Assert.Equal(3, df.Columns
[
"Int"][3]);
590
Assert.Equal(4, df.Columns
[
"Int"][4]);
591
Assert.Null(df.Columns
[
"Int"][5]);
592
Assert.Equal(6, df.Columns
[
"Int"][6]);
593
Assert.Equal(7, df.Columns
[
"Int"][7]);
594
Assert.Equal(7, df.Columns
[
"Int"][8]);
595
Assert.Equal(7, df.Columns
[
"Int"][9]);
645
Assert.Equal(i, df.Columns
[
"Int"][i]);
647
Assert.Null(df.Columns
[
"Int"][5]);
711
foreach (int? value in sampled.Columns
[
"Int"])
859
DataFrame valueCounts = df.Columns
[
"Bool"].ValueCounts();
861
Assert.Equal((long)5, valueCounts.Columns
[
"Counts"][0]);
862
Assert.Equal((long)5, valueCounts.Columns
[
"Counts"][1]);
870
Int32DataFrameColumn column = df.Columns
[
"Int1"] as Int32DataFrameColumn;
915
Int32DataFrameColumn intColumn = intDf.Columns
[
"Int1"] as Int32DataFrameColumn;
934
BooleanDataFrameColumn bigInts = new BooleanDataFrameColumn("BigInts", df.Columns
[
"Int"].ElementwiseGreaterThan(5));
1130
Assert.Equal(15, df.Columns
[
"Column1"].Length);
1131
Assert.Equal(15, df.Columns
[
"Column2"].Length);
1137
Assert.Equal(16, ret.Columns
[
"Column1"].Length);
1138
Assert.Equal(16, ret.Columns
[
"Column2"].Length);
1144
Assert.Equal(16, df.Columns
[
"Column1"].Length);
1145
Assert.Equal(16, df.Columns
[
"Column2"].Length);
1150
Assert.Equal(17, ret.Columns
[
"Column1"].Length);
1151
Assert.Equal(17, ret.Columns
[
"Column2"].Length);
1157
Assert.Equal(17, df.Columns
[
"Column1"].Length);
1158
Assert.Equal(17, df.Columns
[
"Column2"].Length);
1163
Assert.Equal(18, ret.Columns
[
"Column1"].Length);
1164
Assert.Equal(18, ret.Columns
[
"Column2"].Length);
1175
Assert.Equal(18, df.Columns
[
"Column1"].Length);
1176
Assert.Equal(18, df.Columns
[
"Column2"].Length);
1182
Assert.Equal(18, df.Columns
[
"Column1"].Length);
1183
Assert.Equal(18, df.Columns
[
"Column2"].Length);
1187
Assert.Equal(19, ret.Columns
[
"Column1"].Length);
1188
Assert.Equal(19, ret.Columns
[
"Column2"].Length);
1369
Assert.Equal(3, filteredNullDf.Columns
[
"col"].Length);
1371
Assert.Equal("One", filteredNullDf.Columns
[
"col"][0]);
1372
Assert.Equal("Two", filteredNullDf.Columns
[
"col"][1]);
1373
Assert.Equal("Three", filteredNullDf.Columns
[
"col"][2]);
1390
Assert.Equal(2, filteredNullDf.Columns
[
"index"][0]);
1391
Assert.Equal(5, filteredNullDf.Columns
[
"index"][1]);
DataFrameTests.Filter.cs (2)
20
DataFrameColumn filtered = df.Columns
[
"Int"].Filter(3, 7);
32
DataFrame boolColumnFiltered = df[df.Columns
[
"Bool"].ElementwiseEquals(true)];
DataFrameTests.Join.cs (16)
27
Assert.Null(join.Columns
[
"Int_right"][6]);
34
Assert.Equal(join.Columns
[
"Int_right"][3], right.Columns
[
"Int"][3]);
35
Assert.Null(join.Columns
[
"Int_right"][2]);
42
Assert.Null(join.Columns
[
"Int_right"][6]);
49
Assert.Equal(join.Columns
[
"Int_right"][3], right.Columns
[
"Int"][3]);
50
Assert.Null(join.Columns
[
"Int_right"][2]);
59
Assert.Equal(join.Columns
[
"Int_right"][6], right.Columns
[
"Int"][6]);
66
Assert.Equal(join.Columns
[
"Int_right"][2], right.Columns
[
"Int"][2]);
67
Assert.Null(join.Columns
[
"Int_left"][12]);
74
Assert.Null(join.Columns
[
"Int_left"][12]);
81
Assert.Equal(join.Columns
[
"Int_right"][2], right.Columns
[
"Int"][2]);
DataFrameTests.Merge.cs (36)
31
Assert.Equal("Left", (string)merge.Columns
[
"String_left"][0]);
32
Assert.Equal("Right", (string)merge.Columns
[
"String_right"][0]);
46
Assert.Null(merge.Columns
[
"Int_right"][6]);
47
Assert.Null(merge.Columns
[
"Int_left"][5]);
54
Assert.Equal(merge.Columns
[
"Int_right"][3], right.Columns
[
"Int"][3]);
55
Assert.Null(merge.Columns
[
"Int_right"][2]);
62
Assert.Null(merge.Columns
[
"Int_right"][6]);
69
Assert.Equal(merge.Columns
[
"Int_right"][2], right.Columns
[
"Int"][3]);
70
Assert.Null(merge.Columns
[
"Int_right"][4]);
79
Assert.Equal(merge.Columns
[
"Int_right"][6], right.Columns
[
"Int"][6]);
86
Assert.Equal(merge.Columns
[
"Int_right"][2], right.Columns
[
"Int"][2]);
87
Assert.Null(merge.Columns
[
"Int_left"][12]);
94
Assert.Null(merge.Columns
[
"Int_left"][12]);
95
Assert.Null(merge.Columns
[
"Int_left"][15]);
102
Assert.Equal(merge.Columns
[
"Int_right"][2], right.Columns
[
"Int"][2]);
711
Assert.Equal(0, (int)merge.Columns
[
"Int_left"][0]);
712
Assert.Equal(1, (int)merge.Columns
[
"Int_left"][1]);
771
for (int i = 0; i < merge.Columns
[
"Int_left"].Length; i++)
773
if (merge.Columns
[
"Int_left"][i] == null)
775
intersection.Add((int)merge.Columns
[
"Int_left"][i]);
777
for (int i = 0; i < left.Columns
[
"Int"].Length; i++)
779
if (left.Columns
[
"Int"][i] != null && intersection.Contains((int)left.Columns
[
"Int"][i]))
780
intersection.Remove((int)left.Columns
[
"Int"][i]);
787
for (int i = 0; i < merge.Columns
[
"Int_right"].Length; i++)
789
if (merge.Columns
[
"Int_right"][i] == null)
791
intersection.Add((int)merge.Columns
[
"Int_right"][i]);
793
for (int i = 0; i < right.Columns
[
"Int"].Length; i++)
795
if (right.Columns
[
"Int"][i] != null && intersection.Contains((int)right.Columns
[
"Int"][i]))
796
intersection.Remove((int)right.Columns
[
"Int"][i]);
DataFrameTests.Sort.cs (7)
20
df.Columns
[
"Int"][0] = 100000;
21
df.Columns
[
"Int"][df.Rows.Count - 1] = -1;
22
df.Columns
[
"Int"][5] = 200000;
28
Assert.Null(sortedDf.Columns
[
"Int"][sortedDf.Rows.Count - 1]);
29
Assert.Equal(1, sortedDf.Columns
[
"Int"][0]);
30
Assert.Equal(100000, sortedDf.Columns
[
"Int"][sortedDf.Rows.Count - 3]);
31
Assert.Equal(200000, sortedDf.Columns
[
"Int"][sortedDf.Rows.Count - 2]);
PrimitiveDataFrameColumnTests.cs (6)
498
Assert.Equal(3, filteredNullDf.Columns
[
"col"].Length);
500
Assert.Equal(1.23, filteredNullDf.Columns
[
"col"][0]);
501
Assert.Equal(2.0, filteredNullDf.Columns
[
"col"][1]);
502
Assert.Equal(3.0, filteredNullDf.Columns
[
"col"][2]);
519
Assert.Equal(2, filteredNullDf.Columns
[
"index"][0]);
520
Assert.Equal(5, filteredNullDf.Columns
[
"index"][1]);