In the dataprep Python library, you will only import pandas so that we can take the CSV file and turn it into a pandas DataFrame. Once we have a pandas DataFrame we will filter out on Rainbow Beach (in our case, we are only looking at Rainbow Beach). Then we will take out anomalous data such as data where the water temperature is below -100 degrees. Then we will convert the time string into a string that pandas can read. We do this so that when it outputs, it outputs to a standard time series format. Then we select only the two columns we need to analyze, Measurement Timestamp and Turbidity. Finally, we save the file in CSV format.
Next, we create a Luminol file. From here, we use pip to install luminol and time. We then use the anomaly detector on the CSV file and return all of the scores. Finally, we return scores if the value of our score item is greater than 0. In other words, we only return scores if there is an anomaly.