Populate Dataset With Table Names From Stored Procedure

Your SP is not actually returning multiple tables, its returning a selection of columns and rows from your tables, therefore there is no ‘table name’, and hence why they are named table1, table2 etc. If its important, you could return an extra column for each selection, and in that column fill it with the desired … Read more

DataTable to List

I have another approach that might be worth taking a look at. It’s a helper method. Create a custom class file named CollectionHelper: public static IList<T> ConvertTo<T>(DataTable table) { if (table == null) return null; List<DataRow> rows = new List<DataRow>(); foreach (DataRow row in table.Rows) rows.Add(row); return ConvertTo<T>(rows); } Imagine you want to get a … Read more

Interpolation over an array (or two)

The other answers give you linear interpolations — these don’t really work for complex, nonlinear data. You want a spline fit, (spline interpolation) I believe. Spline fits describe regions of the data using a set of control points from the data, then apply a polynomial interpolation between control points. More control points gives you a … Read more

Chart.js Line, different fill color for negative point

You can extend the line chart to do this. Preview Script Chart.defaults.NegativeTransparentLine = Chart.helpers.clone(Chart.defaults.line); Chart.controllers.NegativeTransparentLine = Chart.controllers.line.extend({ update: function () { // get the min and max values var min = Math.min.apply(null, this.chart.data.datasets[0].data); var max = Math.max.apply(null, this.chart.data.datasets[0].data); var yScale = this.getScaleForId(this.getDataset().yAxisID); // figure out the pixels for these and the value 0 var top … Read more

How do I transform a List into a DataSet?

You can do it through reflection and generics, inspecting the properties of the underlying type. Consider this extension method that I use: public static DataTable ToDataTable<T>(this IEnumerable<T> collection) { DataTable dt = new DataTable(“DataTable”); Type t = typeof(T); PropertyInfo[] pia = t.GetProperties(); //Inspect the properties and create the columns in the DataTable foreach (PropertyInfo pi … Read more

Feeding .npy (numpy files) into tensorflow data pipeline

It is actually possible to read directly NPY files with TensorFlow instead of TFRecords. The key pieces are tf.data.FixedLengthRecordDataset and tf.io.decode_raw, along with a look at the documentation of the NPY format. For simplicity, let’s suppose that a float32 NPY file containing an array with shape (N, K) is given, and you know the number … Read more