我尝试从q函数调用k的count函数,但是它给出了错误。
{
"k)"# 1 2 3 4 5 //~ count 1 2 3 4 5
}[]
Run Code Online (Sandbox Code Playgroud)
因此,我有以下问题:
1.是否可以在q脚本中编写k代码?
2.如果是,那么我们如何在q脚本中编写k个代码?在q脚本/函数中使用k代码是否会使脚本/函数更高效和更优化?
小智 6
{
(#:) 1 2 3 4 5
}[]
Run Code Online (Sandbox Code Playgroud)
This will perform a count on the list
q)\t:100000 {(#:) 1 2 3 4 5}[]
29
Run Code Online (Sandbox Code Playgroud)
q)\t:100000 {count 1 2 3 4 5}[]
25
Run Code Online (Sandbox Code Playgroud)
Hope this answers your question