title: How to calculate the steepness of a trend in python
body: <p>I am using the regression slope as follows to calculate the steepness (slope) of the trend.</p>
  
  <p><strong>Scenario 1:</strong>
  For example, consider I am using sales figures (x-axis: <code>1, 4, 6, 8, 10, 15</code>) for 6 days (y-axis).</p>
  
  <pre><code>from sklearn.linear_model import LinearRegression
  regressor = LinearRegression()
  X = [[1], [4], [6], [8], [10], [15]]
  y = [1, 2, 3, 4, 5, 6]
  regressor.fit(X, y)
  print(regressor.coef_)
  </code></pre>
  
  <p>This gives me <code>0.37709497</code></p>
  
  <p><strong>Scenario 2:</strong>
  When I run the same program for a different sale figure (e.g., <code>1, 2, 3, 4, 5, 6</code>) I get the results as <code>1</code>.</p>
  
  <p>However, you can see that <code>sales</code> is much productive in <code>scenario 1</code>, but not in <code>scenario 2</code>. However, the slope I get for <code>scenario 2</code> is higher than <code>scenario 1</code>.</p>
  
  <p>Therefore, I am not sure if the regression slope captures what I require. Is there any other approach I can use instead to calculate the sleepness of the trend slope.</p>
  
  <p>I am happy to provide more details if needed.</p>