0
$\begingroup$

How do I implement sliding window algorithm with a window size of 10 and visualize the data iteratively to see spikes/possible outliers in the dataframe, using python? Please help a beginner.

$\endgroup$
3
  • 1
    $\begingroup$ Are you actually looking for an algorithm that detects spikes (anomaly detection), or simply a way to visualize data 10 observations at a time to manually look for spikes in the data? $\endgroup$
    – Ryan
    May 31, 2018 at 16:47
  • $\begingroup$ $There are gems$ -: “Open Machine Learning Course. Topic 9. Part 1. Time series analysis in Python” medium.com/open-machine-learning-course/…,“Open Machine Learning Course. Topic 9. Part 2. Predicting the future with Facebook Prophet” medium.com/open-machine-learning-course/… $\endgroup$
    – Aditya
    May 31, 2018 at 16:54
  • $\begingroup$ Thanks @Aditya the resource you provided was extremely helpful! Ryan, I am looking to detect random spikes on data and smoothen them out, as well as to visualize them in smaller windows. $\endgroup$
    – natg
    May 31, 2018 at 19:11

1 Answer 1

0
$\begingroup$

welcome to DS-SE and to Data Science in general! :)

Your problem can be solved really easily in Python. Please, take a look at Pandas DataFrame class to represent your data, it makes it really convenient because of all the pre-built methods that includes.

One of its methods is pandas.DataFrame.rolling() (see here) that does exactly what you asked for: rolling (sliding) window calculations, please take a look!

Hope it helps!

$\endgroup$
1
  • 1
    $\begingroup$ @pdko1 this is exactly what I was looking to do! Thanks so much! $\endgroup$
    – natg
    May 31, 2018 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.