Input Table: Input Table
Required Output : Output Image, I want the column name addition which should be loop based because each if my number of column will change, it should automatically take care and update the table with column names.
试过的代码:
Getting Output: Generated Output form Code
请让我知道我能达到这个要求的输出吗?
在不带标题的csv中读取时,没有列名,但是pandas使用索引来访问列。打电话时
它看起来像这样:
因此,您可以简单地进行迭代并执行以下操作:
The
df.rename
function needs simply a dictionary, where the keys are the old column names or indizes and the value is the new name.