【发布时间】:2018-08-31 09:10:20
【问题描述】:
基于这个答案,我想动态构建组合列
df_post['sort_column'] = df_post.apply(lambda r:str([r[col1],r[col2],r[col3]]), axis=1)
df_post = df_post.set_index('sort_column')
df_post = df_post.map_partitions(lambda x: x.sort_index())
我无法根据配置文件提供的列列表找出使此“[r[col1],r[col2],r[col3]]”动态的方法。
【问题讨论】:
-
您能否发布一个具有所需输出的数据示例?
标签: python pandas sorting apply dask