Thursday, October 29, 2020

Python: How to Add a Trend Line to a Line Chart/Graph

In this article, you will learn how to add a trend line to the line chart/line graph using Python Matplotlib. As a data scientist, it proves to be helpful to learn the concepts and related Python code, which can be used to draw or add the trend line to the line charts as it helps understand the trend and make decisions.

In this post, we will consider an example of IPL average batting scores of Virat Kohli, Chris Gayle, MS Dhoni, and Rohit Sharma of the last 10 years and assess the trend related to their overall performance using trend lines. What's the main reason we want to understand the trend line? The primary goal is to assess who could the larger money be put in order to acquire him for the team? The batsman who has the largest upward trend line with the highest slope is the one I would like to put my money on. Having said that, the batting scores mean and variance/standard deviation also comes into the picture in taking the final decision on who to put larger money on.



from DZone.com Feed https://ift.tt/2J9nRNV

No comments:

Post a Comment