From the course: Practical Python for Algorithmic Trading

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Pandas reporting with heatmaps

Pandas reporting with heatmaps

- [Instructor] In the previous tutorial, we calculated the returns for each combination of limit buy and limit sell that we had on the investment strategy. To better interpret these results we will process these objects and turn it into a data frame. With the function reset_index, we save it into a variable and we will make it pivot so that we can see all the results with this layout, now we save it back into a variable. We would like the columns to start from zero to minus 10 so we need to sort the index by the columns. That's why we put axis y in ascending false. Now, we will style the data frame to represent the information without decimals and to create a heat map with the function background_gradient. The cells of the data frame are color based on each column's minimum and maximum values but we would like the cells to be darker based on the overall maximum value. Therefore, we use the parameters vmin, DFF values minimum…

Contents