如何一次传递多列给 replaceColumn!?

huangapple go评论51阅读模式
英文:

How to pass multiple columns to replaceColumn! at once?

问题

如何使用replaceColumn!一次更改多个列的数据类型?

英文:

I want to change the data type of specific columns with replaceColumn!. But I can only pass one column at a time to the function.

How to change the data types of multiple columns with just one command?

答案1

得分: 1

在DolphinDB中,replaceColumn!(table,colName,newCol)支持更改仅一个列的数据类型,因为参数colName被设计为一个字符串标量。

要一次替换多列使用replaceColumn!,请使用eacheach(replaceColumn!{t}, [col1, col2...], [newcol1, newcol2...])

英文:

In DolphinDB, replaceColumn!(table,colName,newCol) supports changing the data type of only one column, because the parameter colName is designed as a string scalar.

To replace multiple columns at once with replaceColumn!, use each: each(replaceColumn!{t}, [col1, col2...], [newcol1, newcol2...]).

huangapple
  • 本文由 发表于 2023年5月26日 10:09:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76337246.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定