一般来说,我想在字符串中找到一些子字符串,但前提是它包含在那里.
我有表情:
^.*(\bpass\b)?.*$
Run Code Online (Sandbox Code Playgroud)
并测试字符串:
high pass h3
Run Code Online (Sandbox Code Playgroud)
当我通过表达式测试字符串时,我看到找到整个字符串(但是组"传递"不是):
match : true
groups count : 1
group : high pass h3
Run Code Online (Sandbox Code Playgroud)
但我需要的是,这场比赛有两组:1:高传h3 2:传球
当我测试时,例如,字符串 - 高h3,我仍然找到1组 - 高h3
我怎样才能做到这一点?
如何规范化deedle框架中的数据?
我尝试过这种方法,但一种方法不起作用
let iris = Frame.ReadCsv("./iris.csv")
let keys = iris.ColumnKeys |> Seq.toArray
let x = iris.Columns.[keys.[0..4]]
let mu = x |> Stats.mean
let std = x |> Stats.stdDev
//Not working becasue couldnt substract series from frame
let norm = (x - mu) / std
Run Code Online (Sandbox Code Playgroud) 我想在我的计算表达式上定义一些自定义运算符,但无法使其工作
type ZipSeq() =
[<CustomOperation("<*>")>]
member this.Apply f s =
f |> Seq.zip s |> Seq.map (fun (y, x) -> x(y))
member this.Return x =
Seq.initInfinite (fun _ -> x)
// (a -> b) -> seq<a> -> seq<b>
[<CustomOperation("<!>")>]
member this.Map f s =
this.Apply (this.Return f) s
let zipSeq = new ZipSeq()
let f (a : float) = a * a
let s = seq { yield 1. }
// seq<b>
let h1 = zipSeq.Map f s
//thinking h1 …Run Code Online (Sandbox Code Playgroud)