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)
177
Assert.Equal(1, df.Columns
[
"Column1"][1]);
178
df.Columns
[
"Column1"][1] = 100;
179
Assert.Equal(100, df.Columns
[
"Column1"][1]);
180
Assert.Equal(0, df.Columns
[
"Column1"].NullCount);
199
Assert.Equal(0, df.Columns
[
"EmptyNullBitMapColumn"].NullCount);
200
Assert.Equal(10, df.Columns
[
"EmptyNullBitMapColumn"].Length);
201
df.Columns
[
"EmptyNullBitMapColumn"][9] = null;
202
Assert.Equal(1, df.Columns
[
"EmptyNullBitMapColumn"].NullCount);
203
Assert.Equal(10, df.Columns
[
"EmptyDataColumn"].NullCount);
204
Assert.Equal(10, df.Columns
[
"EmptyDataColumn"].Length);
205
df.Columns
[
"EmptyDataColumn"][9] = 9;
206
Assert.Equal(9, df.Columns
[
"EmptyDataColumn"].NullCount);
207
Assert.Equal(10, df.Columns
[
"EmptyDataColumn"].Length);
210
Assert.Equal(i, (int)df.Columns
[
"EmptyNullBitMapColumn"][i]);
211
Assert.Null(df.Columns
[
"EmptyDataColumn"][i]);
218
Assert.Equal(0, emptyDataFrame.Columns
[
"EmptyDataAndNullColumns"].Length);
219
Assert.Equal(0, emptyDataFrame.Columns
[
"EmptyDataAndNullColumns"].NullCount);
DataFrame.IOTests.cs (19)
164
Assert.Equal(verifyCMT, df.Columns
[
"vendor_id"][3]);
176
Assert.Equal(verifyCMT, reducedRows.Columns
[
"vendor_id"][2]);
248
Assert.Equal("CMT", df.Columns
[
"vendor_id"][3]);
254
Assert.Equal("CRD", df.Columns
[
"payment_type"][0]);
255
Assert.Equal("CRD_1", df.Columns
[
"payment_type.1"][0]);
256
Assert.Equal("Test", df.Columns
[
"payment_type.2"][0]);
277
Assert.Equal(verifyCMT, df.Columns
[
"Column0"][3]);
290
Assert.Equal(verifyCMT, reducedRows.Columns
[
"Column0"][2]);
316
Assert.Equal(verifyCMT, df.Columns
[
"Column0"][3]);
329
Assert.Equal(verifyCMT, reducedRows.Columns
[
"Column0"][2]);
559
var dateTimeColumn = df.Columns
[
"date"];
592
Assert.Equal("CMT", df.Columns
[
"vendor_id"][4]);
598
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
631
Assert.Equal("CMT", df.Columns
[
"vendor_id"][4]);
637
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
669
Assert.Equal("CMT", df.Columns
[
"vendor_id"][3]);
675
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
768
Assert.Equal("CMT", df.Columns
[
"vendor_id"][3]);
774
Assert.Equal("CMT", reducedRows.Columns
[
"vendor_id"][2]);
DataFrameIDataViewTests.cs (9)
279
Assert.True(df.Columns
[
"Int"].ElementwiseEquals(newDf.Columns
[
"Int"]).All());
280
Assert.True(df.Columns
[
"Double"].ElementwiseEquals(newDf.Columns
[
"Double"]).All());
338
Assert.Equal(df.Columns
[
"Int"][r], newDf.Columns
[
"Int"][r]);
339
Assert.Equal(df.Columns
[
"Double"][r], newDf.Columns
[
"Double"][r]);
379
Assert.Equal(value, df.Columns
[
columnName][cc++]);
DataFrameTests.BinaryOperations.cs (30)
104
newColumn = df1.Columns
[
df1.Columns[i].Name] + df2.Columns
[
df2.Columns[i].Name];
108
newColumn = df1.Columns
[
df1.Columns[i].Name] - df2.Columns
[
df2.Columns[i].Name];
112
newColumn = df1.Columns
[
df1.Columns[i].Name] * df2.Columns
[
df2.Columns[i].Name];
126
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseEquals(df2.Columns
[
df2.Columns[i].Name]);
129
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseNotEquals(df2.Columns
[
df2.Columns[i].Name]);
132
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseGreaterThanOrEqual(df2.Columns
[
df2.Columns[i].Name]);
135
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseLessThanOrEqual(df2.Columns
[
df2.Columns[i].Name]);
138
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseGreaterThan(df2.Columns
[
df2.Columns[i].Name]);
141
verify = df1.Columns
[
df1.Columns[i].Name].ElementwiseLessThan(df2.Columns
[
df2.Columns[i].Name]);
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);
393
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);
413
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
422
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
428
Assert.True(typeof(decimal) == tempDf.Columns
[
"Int"].DataType);
448
Int32DataFrameColumn ints = df.Columns
[
"Int"] as Int32DataFrameColumn;
474
BooleanDataFrameColumn bools = df.Columns
[
"Bool"] as BooleanDataFrameColumn;
DataFrameTests.Computations.cs (141)
23
Assert.Equal(-10, df.Columns
[
"Int"][0]);
25
DataFrameColumn absColumn = df.Columns
[
"Int"].Abs();
27
Assert.Equal(-10, df.Columns
[
"Int"][0]);
28
df.Columns
[
"Int"].Abs(true);
29
Assert.Equal(10, df.Columns
[
"Int"][0]);
31
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].All());
32
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].Any());
33
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].All());
34
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].Any());
35
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].All());
36
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].Any());
37
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].All());
38
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].Any());
39
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].All());
40
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].Any());
41
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].All());
42
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].Any());
43
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].All());
44
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].Any());
45
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].All());
46
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].Any());
47
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].All());
48
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].Any());
49
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].All());
50
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].Any());
51
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].All());
52
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].Any());
53
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].All());
54
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].Any());
55
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].All());
56
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].Any());
58
bool any = df.Columns
[
"Bool"].Any();
59
bool all = df.Columns
[
"Bool"].All();
64
df.Columns
[
"Double"][0] = 100.0;
65
DataFrameColumn doubleColumn = df.Columns
[
"Double"].CumulativeMax();
73
Assert.Equal(1.0, df.Columns
[
"Double"][1]);
74
df.Columns
[
"Double"].CumulativeMax(true);
75
for (int i = 0; i < df.Columns
[
"Double"].Length; i++)
78
Assert.Null(df.Columns
[
"Double"][i]);
80
Assert.Equal(100.0, (double)df.Columns
[
"Double"][i]);
83
df.Columns
[
"Float"][0] = -10.0f;
84
DataFrameColumn floatColumn = df.Columns
[
"Float"].CumulativeMin();
92
Assert.Equal(9.0f, df.Columns
[
"Float"][9]);
93
df.Columns
[
"Float"].CumulativeMin(true);
94
for (int i = 0; i < df.Columns
[
"Float"].Length; i++)
97
Assert.Null(df.Columns
[
"Float"][i]);
99
Assert.Equal(-10.0f, (float)df.Columns
[
"Float"][i]);
102
DataFrameColumn uintColumn = df.Columns
[
"Uint"].CumulativeProduct();
104
Assert.Equal((uint)8, df.Columns
[
"Uint"][8]);
105
df.Columns
[
"Uint"].CumulativeProduct(true);
106
Assert.Equal((uint)0, df.Columns
[
"Uint"][9]);
108
DataFrameColumn ushortColumn = df.Columns
[
"Ushort"].CumulativeSum();
110
Assert.Equal((ushort)9, df.Columns
[
"Ushort"][9]);
111
df.Columns
[
"Ushort"].CumulativeSum(true);
112
Assert.Equal((ushort)40, df.Columns
[
"Ushort"][9]);
114
Assert.Equal(100.0, df.Columns
[
"Double"].Max());
115
Assert.Equal(-10.0f, df.Columns
[
"Float"].Min());
116
Assert.Equal((uint)0, df.Columns
[
"Uint"].Product());
117
Assert.Equal((ushort)130, df.Columns
[
"Ushort"].Sum());
119
df.Columns
[
"Double"][0] = 100.1;
120
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
121
DataFrameColumn roundColumn = df.Columns
[
"Double"].Round();
123
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
124
df.Columns
[
"Double"].Round(true);
125
Assert.Equal(100.0, df.Columns
[
"Double"][0]);
185
Assert.Equal(-10, df.Columns
[
"Int"][0]);
187
DataFrameColumn absColumn = df.Columns
[
"Int"].Abs();
189
Assert.Equal(-10, df.Columns
[
"Int"][0]);
190
df.Columns
[
"Int"].Abs(true);
191
Assert.Equal(10, df.Columns
[
"Int"][0]);
193
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].All());
194
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Byte"].Any());
195
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].All());
196
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Char"].Any());
197
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].All());
198
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Decimal"].Any());
199
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].All());
200
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Double"].Any());
201
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].All());
202
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Float"].Any());
203
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].All());
204
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Int"].Any());
205
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].All());
206
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Long"].Any());
207
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].All());
208
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Sbyte"].Any());
209
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].All());
210
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Short"].Any());
211
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].All());
212
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Uint"].Any());
213
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].All());
214
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ulong"].Any());
215
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].All());
216
Assert.Throws<NotSupportedException>(() => df.Columns
[
"Ushort"].Any());
217
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].All());
218
Assert.Throws<NotSupportedException>(() => df.Columns
[
"DateTime"].Any());
222
df.Columns
[
"DateTime"][0] = maxDate;
223
DataFrameColumn dateTimeColumn = df.Columns
[
"DateTime"].CumulativeMax();
233
df.Columns
[
"Double"][0] = 100.0;
234
DataFrameColumn doubleColumn = df.Columns
[
"Double"].CumulativeMax();
242
Assert.Equal(1.0, df.Columns
[
"Double"][1]);
243
df.Columns
[
"Double"].CumulativeMax(true);
244
for (int i = 0; i < df.Columns
[
"Double"].Length; i++)
247
Assert.Null(df.Columns
[
"Double"][i]);
249
Assert.Equal(100.0, (double)df.Columns
[
"Double"][i]);
252
df.Columns
[
"Float"][0] = -10.0f;
253
DataFrameColumn floatColumn = df.Columns
[
"Float"].CumulativeMin();
261
Assert.Equal(9.0f, df.Columns
[
"Float"][9]);
262
df.Columns
[
"Float"].CumulativeMin(true);
263
for (int i = 0; i < df.Columns
[
"Float"].Length; i++)
266
Assert.Null(df.Columns
[
"Float"][i]);
268
Assert.Equal(-10.0f, (float)df.Columns
[
"Float"][i]);
271
DataFrameColumn uintColumn = df.Columns
[
"Uint"].CumulativeProduct();
273
Assert.Equal((uint)8, df.Columns
[
"Uint"][8]);
274
df.Columns
[
"Uint"].CumulativeProduct(true);
275
Assert.Equal((uint)0, df.Columns
[
"Uint"][9]);
277
DataFrameColumn ushortColumn = df.Columns
[
"Ushort"].CumulativeSum();
279
Assert.Equal((ushort)9, df.Columns
[
"Ushort"][9]);
280
df.Columns
[
"Ushort"].CumulativeSum(true);
281
Assert.Equal((ushort)40, df.Columns
[
"Ushort"][9]);
283
Assert.Equal(100.0, df.Columns
[
"Double"].Max());
284
Assert.Equal(-10.0f, df.Columns
[
"Float"].Min());
285
Assert.Equal((uint)0, df.Columns
[
"Uint"].Product());
286
Assert.Equal((ushort)130, df.Columns
[
"Ushort"].Sum());
288
df.Columns
[
"Double"][0] = 100.1;
289
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
290
DataFrameColumn roundColumn = df.Columns
[
"Double"].Round();
292
Assert.Equal(100.1, df.Columns
[
"Double"][0]);
293
df.Columns
[
"Double"].Round(true);
294
Assert.Equal(100.0, df.Columns
[
"Double"][0]);
424
var byteColumn = (PrimitiveDataFrameColumn<byte>)df.Columns
[
"Byte"];
425
var decimalColumn = (PrimitiveDataFrameColumn<decimal>)df.Columns
[
"Decimal"];
426
var doubleColumn = (PrimitiveDataFrameColumn<double>)df.Columns
[
"Double"];
427
var floatColumn = (PrimitiveDataFrameColumn<float>)df.Columns
[
"Float"];
428
var intColumn = (PrimitiveDataFrameColumn<int>)df.Columns
[
"Int"];
429
var longColumn = (PrimitiveDataFrameColumn<long>)df.Columns
[
"Long"];
430
var sbyteColumn = (PrimitiveDataFrameColumn<sbyte>)df.Columns
[
"Sbyte"];
431
var shortColumn = (PrimitiveDataFrameColumn<short>)df.Columns
[
"Short"];
432
var uintColumn = (PrimitiveDataFrameColumn<uint>)df.Columns
[
"Uint"];
433
var ulongColumn = (PrimitiveDataFrameColumn<ulong>)df.Columns
[
"Ulong"];
434
var ushortColumn = (PrimitiveDataFrameColumn<ushort>)df.Columns
[
"Ushort"];
DataFrameTests.cs (120)
55
var dc = df.Columns
[
"a1"];
132
DataFrameColumn intColumn_1 = dataFrame.Columns
[
"NewIntColumn"];
136
DataFrameColumn lastColumn_1 = dataFrame.Columns
[
originalLastColumn.Name];
231
df["Int3"] = df.Columns
[
"Int1"] * 2 + df.Columns
[
"Int2"];
232
Assert.Equal(16, df.Columns
[
"Int3"][2]);
239
df.Columns
[
"Int"][0] = 100;
240
df.Columns
[
"Int"][19] = -1;
241
df.Columns
[
"Int"][5] = 2000;
245
Assert.Null(sortedDf.Columns
[
"Int"][19]);
246
Assert.Equal(-1, sortedDf.Columns
[
"Int"][0]);
247
Assert.Equal(100, sortedDf.Columns
[
"Int"][17]);
248
Assert.Equal(2000, sortedDf.Columns
[
"Int"][18]);
252
Assert.Null(sortedDf.Columns
[
"Int"][19]);
253
Assert.Equal(-1, sortedDf.Columns
[
"Int"][18]);
254
Assert.Equal(100, sortedDf.Columns
[
"Int"][1]);
255
Assert.Equal(2000, sortedDf.Columns
[
"Int"][0]);
259
Assert.Null(sortedDf.Columns
[
"Int"][0]);
260
Assert.Equal(-1, sortedDf.Columns
[
"Int"][1]);
261
Assert.Equal(100, sortedDf.Columns
[
"Int"][18]);
262
Assert.Equal(2000, sortedDf.Columns
[
"Int"][19]);
266
Assert.Null(sortedDf.Columns
[
"Int"][0]);
267
Assert.Equal(-1, sortedDf.Columns
[
"Int"][19]);
268
Assert.Equal(100, sortedDf.Columns
[
"Int"][2]);
269
Assert.Equal(2000, sortedDf.Columns
[
"Int"][1]);
273
Assert.Null(sortedDf.Columns
[
"Int"][19]);
274
Assert.Equal(1, sortedDf.Columns
[
"Int"][1]);
275
Assert.Equal(8, sortedDf.Columns
[
"Int"][17]);
276
Assert.Equal(9, sortedDf.Columns
[
"Int"][18]);
280
Assert.Null(sortedDf.Columns
[
"Int"][19]);
281
Assert.Equal(8, sortedDf.Columns
[
"Int"][1]);
282
Assert.Equal(9, sortedDf.Columns
[
"Int"][0]);
286
Assert.Null(sortedDf.Columns
[
"Int"][0]);
287
Assert.Equal(1, sortedDf.Columns
[
"Int"][2]);
288
Assert.Equal(8, sortedDf.Columns
[
"Int"][18]);
289
Assert.Equal(9, sortedDf.Columns
[
"Int"][19]);
293
Assert.Null(sortedDf.Columns
[
"Int"][0]);
294
Assert.Equal(8, sortedDf.Columns
[
"Int"][2]);
295
Assert.Equal(9, sortedDf.Columns
[
"Int"][1]);
304
Assert.Equal((long)5, count.Columns
[
"Int"][0]);
305
Assert.Equal((long)4, count.Columns
[
"Decimal"][1]);
321
DataFrameColumn firstColumn = first.Columns
[
originalColumn.Name];
333
DataFrameColumn headColumn = head.Columns
[
originalColumn.Name];
342
DataFrameColumn headColumn = head.Columns
[
originalColumn.Name];
356
DataFrameColumn tailColumn = tail.Columns
[
originalColumn.Name];
370
DataFrameColumn maxColumn = max.Columns
[
originalColumn.Name];
393
DataFrameColumn minColumn = min.Columns
[
originalColumn.Name];
396
DataFrameColumn productColumn = product.Columns
[
originalColumn.Name];
399
DataFrameColumn sumColumn = sum.Columns
[
originalColumn.Name];
406
Assert.Equal(20, columnSum.Columns
[
"Int"][0]);
407
Assert.Equal(20, columnSum.Columns
[
"Int"][1]);
410
Assert.Equal(8, columnMax.Columns
[
"Int"][0]);
411
Assert.Equal(9, columnMax.Columns
[
"Int"][1]);
414
Assert.Equal(0, columnProduct.Columns
[
"Int"][0]);
415
Assert.Equal(0, columnProduct.Columns
[
"Int"][1]);
418
Assert.Equal(0, columnMin.Columns
[
"Int"][0]);
419
Assert.Equal(1, columnMin.Columns
[
"Int"][1]);
424
Assert.Equal((long)5, countIntColumn.Columns
[
"Int"][0]);
425
Assert.Equal((long)4, countIntColumn.Columns
[
"Int"][1]);
430
Assert.Equal((decimal)0, firstDecimalColumn.Columns
[
"Decimal"][0]);
431
Assert.Equal((decimal)1, firstDecimalColumn.Columns
[
"Decimal"][1]);
498
StringDataFrameColumn stringColumn = (StringDataFrameColumn)df.Columns
[
"String"];
513
ArrowStringDataFrameColumn arrowStringColumn = (ArrowStringDataFrameColumn)df.Columns
[
"ArrowString"];
528
SingleDataFrameColumn floatColumn = (SingleDataFrameColumn)df.Columns
[
"Float"];
543
Int32DataFrameColumn intColumn = (Int32DataFrameColumn)df.Columns
[
"Int"];
564
DataFrameColumn clamped = df.Columns
[
"Int"].Clamp(3, 7);
566
Assert.Equal(0, df.Columns
[
"Int"][0]);
568
Assert.Equal(1, df.Columns
[
"Int"][1]);
570
Assert.Equal(2, df.Columns
[
"Int"][2]);
572
Assert.Equal(3, df.Columns
[
"Int"][3]);
574
Assert.Equal(4, df.Columns
[
"Int"][4]);
576
Assert.Null(df.Columns
[
"Int"][5]);
578
Assert.Equal(6, df.Columns
[
"Int"][6]);
580
Assert.Equal(7, df.Columns
[
"Int"][7]);
582
Assert.Equal(8, df.Columns
[
"Int"][8]);
584
Assert.Equal(9, df.Columns
[
"Int"][9]);
587
df.Columns
[
"Int"].Clamp(3, 7, true);
588
Assert.Equal(3, df.Columns
[
"Int"][0]);
589
Assert.Equal(3, df.Columns
[
"Int"][1]);
590
Assert.Equal(3, df.Columns
[
"Int"][2]);
591
Assert.Equal(3, df.Columns
[
"Int"][3]);
592
Assert.Equal(4, df.Columns
[
"Int"][4]);
593
Assert.Null(df.Columns
[
"Int"][5]);
594
Assert.Equal(6, df.Columns
[
"Int"][6]);
595
Assert.Equal(7, df.Columns
[
"Int"][7]);
596
Assert.Equal(7, df.Columns
[
"Int"][8]);
597
Assert.Equal(7, df.Columns
[
"Int"][9]);
647
Assert.Equal(i, df.Columns
[
"Int"][i]);
649
Assert.Null(df.Columns
[
"Int"][5]);
713
foreach (int? value in sampled.Columns
[
"Int"])
861
DataFrame valueCounts = df.Columns
[
"Bool"].ValueCounts();
863
Assert.Equal((long)5, valueCounts.Columns
[
"Counts"][0]);
864
Assert.Equal((long)5, valueCounts.Columns
[
"Counts"][1]);
872
Int32DataFrameColumn column = df.Columns
[
"Int1"] as Int32DataFrameColumn;
917
Int32DataFrameColumn intColumn = intDf.Columns
[
"Int1"] as Int32DataFrameColumn;
936
BooleanDataFrameColumn bigInts = new BooleanDataFrameColumn("BigInts", df.Columns
[
"Int"].ElementwiseGreaterThan(5));
1132
Assert.Equal(15, df.Columns
[
"Column1"].Length);
1133
Assert.Equal(15, df.Columns
[
"Column2"].Length);
1139
Assert.Equal(16, ret.Columns
[
"Column1"].Length);
1140
Assert.Equal(16, ret.Columns
[
"Column2"].Length);
1146
Assert.Equal(16, df.Columns
[
"Column1"].Length);
1147
Assert.Equal(16, df.Columns
[
"Column2"].Length);
1152
Assert.Equal(17, ret.Columns
[
"Column1"].Length);
1153
Assert.Equal(17, ret.Columns
[
"Column2"].Length);
1159
Assert.Equal(17, df.Columns
[
"Column1"].Length);
1160
Assert.Equal(17, df.Columns
[
"Column2"].Length);
1165
Assert.Equal(18, ret.Columns
[
"Column1"].Length);
1166
Assert.Equal(18, ret.Columns
[
"Column2"].Length);
1177
Assert.Equal(18, df.Columns
[
"Column1"].Length);
1178
Assert.Equal(18, df.Columns
[
"Column2"].Length);
1184
Assert.Equal(18, df.Columns
[
"Column1"].Length);
1185
Assert.Equal(18, df.Columns
[
"Column2"].Length);
1189
Assert.Equal(19, ret.Columns
[
"Column1"].Length);
1190
Assert.Equal(19, ret.Columns
[
"Column2"].Length);
1371
Assert.Equal(3, filteredNullDf.Columns
[
"col"].Length);
1373
Assert.Equal("One", filteredNullDf.Columns
[
"col"][0]);
1374
Assert.Equal("Two", filteredNullDf.Columns
[
"col"][1]);
1375
Assert.Equal("Three", filteredNullDf.Columns
[
"col"][2]);
1392
Assert.Equal(2, filteredNullDf.Columns
[
"index"][0]);
1393
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)
504
Assert.Equal(3, filteredNullDf.Columns
[
"col"].Length);
506
Assert.Equal(1.23, filteredNullDf.Columns
[
"col"][0]);
507
Assert.Equal(2.0, filteredNullDf.Columns
[
"col"][1]);
508
Assert.Equal(3.0, filteredNullDf.Columns
[
"col"][2]);
525
Assert.Equal(2, filteredNullDf.Columns
[
"index"][0]);
526
Assert.Equal(5, filteredNullDf.Columns
[
"index"][1]);