AttributeError, whein writing back from ipython to Excel with pandas
<p>System:
Windows 7
Anaconda -> Spyder with 2.7.12 Python</p>

<p>I got this AttributeError:</p>

<pre><code>  File "&lt;ipython-input-4-d258b656588d&gt;", line 1, in &lt;module&gt;
    runfile('C:/xxx/.spyder/pandas excel.py', wdir='C:/xxx/.spyder')

  File "C:\xxx\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
    execfile(filename, namespace)

  File "C:\xxx\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/xxx/.spyder/pandas excel.py", line 33, in &lt;module&gt;
    moving_avg.to_excel(writer, sheet_name='Methodentest', startcol=12, startrow=38)

  File "C:\xxx\Anaconda2\lib\site-packages\pandas\core\generic.py", line 2672, in __getattr__
    return object.__getattribute__(self, name)

AttributeError: 'Series' object has no attribute 'to_excel'
</code></pre>

<p>This is my code:</p>

<pre><code>import pandas as pd

#Adjustmend of Data for Date funtioniert nicht?
#parsen = lambda x: pd.datetime.strptime(x, '%Y-%m')

#Open new file object
xl = pd.ExcelFile('C:\xxx\Desktop\Beisspieldatensatz.xlsx')
#parse_dates={'Zeit': ['Jahr', 'Monat']}, index_col = 0,  date_parser=parsen)

#Link to specific sheet
df = xl.parse('Methodentest')

#Narrow the data input
df2 = df[['Jahr', 'Monat', 'Umsatzmenge']]

#Establishment values under the year 2015 
df3 = df2[(df2['Jahr']&lt;2015)]

#Execute gleitender Mittelwert History 36 Month or 36 rows          
moving_avg = pd.rolling_mean(df3["Umsatzmenge"],36)
print (moving_avg.head())

#Create a pandas excel writer
writer = pd.ExcelWriter(r'C:\xxx\Desktop\Beisspieldatensatz.xlsx', engine='xlsxwriter')

# Convert the dataframe to an XlsxWriter Excel object.
moving_avg.to_excel(writer, sheet_name='Methodentest', startcol=12, startrow=38)

# Close the Pandas Excel writer and output the Excel file.
writer.save()
</code></pre>

<p>I want to read a data set in ipython from Excel. In the next step I want to "pare" my data, but this is not working?? (that's why I put this part in hashtag). After this I want do a mathematical method like here moving average for the next 18 month and store this information in moving_average.
My Data set start monthly from the 01.2012. Then the code must write back the new figures in Excel in specific row and column -> Here the error occurred.</p>