I believe need change:
moving_avg = pd.rolling_mean(ts_log,12)
to:
moving_avg = ts_log.rolling(12).mean()
because old pandas version code below pandas 0.18.0
More Related Contents:
- How to provide a reproducible copy of your DataFrame with to_clipboard()
- When should I (not) want to use pandas apply() in my code?
- How can I plot separate Pandas DataFrames as subplots?
- In pandas, is inplace = True considered harmful, or not?
- How do I convert a pandas Series or index to a Numpy array? [duplicate]
- How to reversibly store and load a Pandas dataframe to/from disk
- Pandas convert dataframe to array of tuples
- Update row values where certain condition is met in pandas
- Pandas finding local max and min
- How to import a text file on AWS S3 into pandas without writing to disk
- Python, Pandas : write content of DataFrame into text File
- extracting days from a numpy.timedelta64 value
- Adding calculated column(s) to a dataframe in pandas
- Divide multiple columns by another column in pandas
- Bin pandas dataframe by every X rows
- Set value of one Pandas column based on value in another column
- Python: Removing Rows on Count condition
- Converting Pandas dataframe into Spark dataframe error
- Change main plot legend label text
- Remove NaN/NULL columns in a Pandas dataframe?
- How to specify the type of pandas series elements in type hints?
- Group DataFrame in 5-minute intervals
- Add numpy array as column to Pandas data frame
- Python: How to drop a row whose particular column is empty/NaN?
- Discrete legend in seaborn heatmap plot
- How to use ast.literal_eval in a pandas dataframe and handle exceptions
- Why is NaN considered as a float?
- Clean way to convert quarterly periods to datetime in pandas
- Python Pandas : pandas.to_datetime() is switching day & month when day is less than 13
- Wide to long data transform in pandas