AttributeError: 'list' object has no attribute 'rename'
<pre><code>df.rename(columns={'nan': 'RK', 'PP': 'PLAYER','SH':'TEAM','nan':'GP','nan':'G','nan':'A','nan':'PTS','nan':'+/-','nan':'PIM','nan':'PTS/G','nan':'SOG','nan':'PCT','nan':'GWG','nan':'PPG','nan':'PPA','nan':'SHG','nan':'SHA'}, inplace=True)     
</code></pre>

<p>This is my code to rename the columns according to  <a href="http://www.espn.com/nhl/statistics/player/_/stat/points/sort/points/year/2015/seasontype/2" rel="nofollow">http://www.espn.com/nhl/statistics/player/_/stat/points/sort/points/year/2015/seasontype/2</a></p>

<p>I want both the tables to have same column names. I am using python2 in spyder IDE.<br>
When I run the code above, it gives me this error:</p>

<pre><code>AttributeError: 'list' object has no attribute 'rename'
</code></pre>

<p>You should first use the documentation. Here is the link for Python Data structure.<br>
<a href="https://docs.python.org/3/tutorial/datastructures.html" rel="nofollow">https://docs.python.org/3/tutorial/datastructures.html</a><br>
Select the right data data structure for your use case. </p>

python html spyder data-science edx