pandas DataFrame and pandas.groupby to calculate Salaries
<p>For my assignment, I need to import baseball salary data into a pandas <code>DataFrame</code>.<br>
From there, one of my objectives is to get the salaries of all the teams per year.</p>

<p>I was successful however in order to move onto the next task, I need a pandas <code>DataFrame</code>. <code>sumofSalaries.dtype</code> is returning <code>int64</code>.</p>

<p>Questions:<br>
    1. How do I convert the data in the code following into a DataFrame?<br>
    2. How do I delete the indexes in <code>sumofSalaries</code>?</p>

<p>Code:</p>

<pre><code> import pandas as pd
 salariesData = pd.read_csv('Salaries.csv')

 #sum salaries by year and team
 sumOfSalaries = salariesData.groupby(by=['yearID','teamID'])['salary'].sum()

 del sumOfSalaries.index.names #line giving me errors

 #create DataFrame from grouped data 
 df = pd.DataFrame(sumOfSalaries, columns = ['yearID', 'teamID', 'salary'])
 df

 _____________________________________________________________________________

 sumofSalaries:
 yearID  teamID
 1985    ATL        14807000
         BAL        11560712
         BOS        10897560
         CAL        14427894
         CHA         9846178

 ...and so on
 _____________________________________________________________________________

  df:

            yearID  teamID  salary
 yearID teamID          
 1985   ATL NaN NaN 14807000
        BAL NaN NaN 11560712
        BOS NaN NaN 10897560
        CAL NaN NaN 14427894
</code></pre>