请教大家个大数据计算MaxCompute问题: 对dataframe 列重命名报错:
AttributeError: ‘DataFrame’ object has no attribute ‘rename’
脚本:
from odps import options
from odps.df import DataFrame
mers = DataFrame(o.get_table(‘dim_mer_mer_info’))
print(mers.head(5))
mers.rename(columns={“mer_id”:”mer_id_abc”},inplace=True)
print(mers.head(5))
看报错是转成的DataFrame没有rename方法,目前PyODPS应该是只兼容文档中写了操作。
https://help.aliyun.com/zh/maxcompute/user-guide/overview-13?spm=a2c4g.11186623.0.0.12ef5425w2eByh,此回答整理自钉群“MaxCompute开发者社区2群”