宣告 JSON 字串

1
2
3
DECLARE @json NVARCHAR(MAX);

SET @json = '{"info": {"address": [{"town": "Belgrade"}, {"town": "Paris"}, {"town":"Madrid"}]}}';
Read more »

宣告 XML 資料

1
2
3
4
5
6
7
DECLARE @x XML;

SET @x = '<Root>
<row id="1"><name>Larry</name></row>
<row id="2"><name>moe</name></row>
<row id="3" />
</Root>';
Read more »

初始化設定

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 套件 Microsoft.Data.Analysis 檔案轉 DataFrame 格式
#r "nuget: Microsoft.Data.Analysis, 0.21.1"
// 套件 MathNet.Numerics 進行數學計算
#r "nuget: MathNet.Numerics, 5.0.0"
// 套件 ScottPlot 產生圖片
#r "nuget:ScottPlot, 5.0.*"

using System.IO;
using Microsoft.Data.Analysis;
using MathNet.Numerics.Distributions;

// 設定 ScottPlot 圖片格式
using Microsoft.DotNet.Interactive.Formatting;
Formatter.Register(typeof(ScottPlot.Plot), (p, w) =>
w.Write(((ScottPlot.Plot)p).GetImageHtml(400, 300)), HtmlFormatter.MimeType);
Read more »
0%