From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms

Unlock the full course today

Join today to access over 24,300 courses taught by industry experts.

Solution: Running algorithms with Python in Excel

Solution: Running algorithms with Python in Excel

(bright music) - [Instructor] In codespaces, I already set up the ETL framework to get the weather data from the National Weather Service API. We discussed earlier that for security concerns, we want to get data into Excel via the web data connector and Power Query instead of directly within Python code. However, in ids like this one, we'll make the request directly in our Python code through the request library. I'm going to first import the libraries that we want to use. We'll then run the steps to create the data frame object to use in the anomaly detection algorithm directly in the notebook. Next, let's create a NumPy array to store the temperatures that we'll use in the algorithm. We'll then reshape it to work in the algorithm by chaining reshape to the end of it. Next, let's call the DBSCAN function and assign it to a new clusters variable. Within this function, let's set our epsilon parameter to two and our minimum samples parameter to 12. We'll then call the fit_predict method…

Contents