A nested list :
q)ls:(1 2;1 2;3 4;3 4;enlist 5;`long$())
q)ls
1 2
1 2
3 4
3 4
,5
`long$()
Question : How do you fill the null?
Solution:
Create a function :
q)f:{$[count y;y;x]}
Apply f to nested list:
q)f\[ls]
1 2
1 2
3 4
3 4
,5
,5
这篇博客介绍了如何使用Q语言中的函数f[]处理嵌套列表ls中的null值,通过定义函数并应用到列表元素上,展示了如何填充列表中的缺失项。
A nested list :
q)ls:(1 2;1 2;3 4;3 4;enlist 5;`long$())
q)ls
1 2
1 2
3 4
3 4
,5
`long$()
Question : How do you fill the null?
Solution:
Create a function :
q)f:{$[count y;y;x]}
Apply f to nested list:
q)f\[ls]
1 2
1 2
3 4
3 4
,5
,5

被折叠的 条评论
为什么被折叠?