【发布时间】:2020-03-21 03:35:22
【问题描述】:
我有列表列名。
columns = ['home','house','office','work']
我想将该列表值作为“选择”数据框中的列名传递。
我试过了……
df_tables_full = df_tables_full.select('time_event','kind','schema','table',columns)
但我收到以下错误..
TypeError: Invalid argument, not a string or column: ['home', 'house', 'office',
'work'] of type <class 'list'>. For column literals, use 'lit', 'array', 'struct'
or 'create_map' function.
你有什么想法吗? 谢谢各位!
【问题讨论】:
标签: python apache-spark pyspark