Пример #1
0
        public void can_get_columns()
        {
            var dataFrame = new DataFrame(
                new IntColumn("Column1"),
                new StringColumn("Column2")
            );

            var columnNames = new string[] { "Column1", "Column2" };
            Assert.Equal(columnNames, dataFrame.GetColumnNames());
        }
Пример #2
0
        public void can_get_values_from_set_columns()
        {
            var dataFrame = new DataFrame()
                .SetColumn("Column1", new IntColumn("Column1", new int[] { 1, 2 }))
                .SetColumn("Column2", new StringColumn("Column2", new string[] { "A", "B" }));

            var columnNames = new string[] { "Column1", "Column2" };
            Assert.Equal(columnNames, dataFrame.GetColumnNames());

            var expectedValues = new Tuple<int, string>[]
            {
                new Tuple<int, string>(1, "A"),
                new Tuple<int, string>(2, "B"),
            };

            Assert.Equal(expectedValues, dataFrame.GetValues<int, string>());
        }