英文:
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!
,请使用each
:each(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...])
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论