Ejemplo n.º 1
0
        public void LoadFromTabularDataResource()
        {
            var schema = new TableSchema();

            schema.Fields.Add(new TableSchemaFieldDescriptor("TrueOrFalse", TableSchemaFieldType.Boolean));
            schema.Fields.Add(new TableSchemaFieldDescriptor("Integer", TableSchemaFieldType.Integer));
            schema.Fields.Add(new TableSchemaFieldDescriptor("Double", TableSchemaFieldType.Number));
            schema.Fields.Add(new TableSchemaFieldDescriptor("Text", TableSchemaFieldType.String));
            var data = new List <IDictionary <string, object> >();

            for (var i = 0; i < 5; i++)
            {
                data.Add(new Dictionary <string, object>
                {
                    ["TrueOrFalse"] = ((i % 2) == 0),
                    ["Integer"]     = i,
                    ["Double"]      = i / 0.5,
                    ["Text"]        = $"hello {i}!"
                });
            }

            var tableData = new TabularDataResource(schema, data);

            var dataFrame = tableData.ToDataFrame();

            Assert.Equal(dataFrame.Columns.Select(c => c.Name).ToArray(), new[] { "TrueOrFalse", "Integer", "Double", "Text" });
        }
Ejemplo n.º 2
0
 public SandDanceDataExplorer(TabularDataResource source)
 {
     Id = Guid.NewGuid().ToString("N");
     TabularDataResource = source;
 }
Ejemplo n.º 3
0
 public NteractDataExplorer(TabularDataResource source)
 {
     Id = Guid.NewGuid().ToString("N");
     TabularDataResource = source;
 }