我是编程和Python新手。您能帮我解决这个错误的原因吗?我已在下面列出了错误。
代码-
country_data_complete = country_data_complete.drop(columns=["City_y", "Host_Country"]),
country_data_complete = country_data_complete.rename({'City_x':'Host_City', 'wb_country_code':'Country_code', 'No. of Atheletes':'No_of_Athelets','Medal':'Total', 'Country':'Country_Name'})
country_data_complete.head()
错误-
AttributeError: 'tuple' object has no attribute 'rename'
最佳答案
第一行末尾有一个逗号 (,
)。不应该存在=p
关于python - 属性错误: 'tuple' object has no attribute for the code below,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63412402/