![](/img/trans.png)
[英]How to re-scale vertices to fit within certain range while preserving aspect ratio?
[英]how re-scale a range of ratio values, to start from 1 rather then 0, without losing statics significance
我正在研究訂閱的預測公式。
——
我面臨的障礙是..
0.56 to 5.54
ratio => 1
df = pd.DataFrame({ "Weeks" : [1,2,3,4,5,6,7,8] ,
"Subscription" : [203,150,120,80,15,13,5,1] })
df["ratio"] = ((df.Subscription_*100) / (df.Subscription_.sum()) )
## So for example:
Actual_value = 100
# if Actual value multiply by number smaller then 1 such **0.56**
# Foretasted value will be smaller then Actual value, but it should be => Equal or Bigger then Actual.
1 to whatever
開始1 to whatever
不失統計顯着性??
有一種方法可以輸出
(df.Subscription-df.Subscription.min())/np.ptp(df.Subscription)
0 1.000000
1 0.737624
2 0.589109
3 0.391089
4 0.069307
5 0.059406
6 0.019802
7 0.000000
Name: Subscription, dtype: float64
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.