The text and pictures of the article are from the Internet, only for learning and communication, and do not have any commercial use. The copyright belongs to the original author. If you have any questions, please contact us in time for handling.
Author: Zhu Xiaowu
PS: if you need Python learning materials, you can click the link below to get them by yourself
Double 11 is over, we have no hands to chop.
Tmall officially announced that the turnover of this year’s double 11 was 268.4 billion yuan, which successfully set its own business record. It’s reasonable to say that everyone is used to increasing year by year, but I didn’t expect that
Because it is too perfect, netizens raise questions.
After tmall announced its sales in 2019, the microblog triggered a lot of discussions and successfully launched hot search.
Some people have come up with the opposite view: for example, the big V @ appendix indicates that tmall’s double 11 data accurately controls the trading volume, thus forming an ideal curve.
And tmall’s relevant person in charge responded that it would be false if it was in line with the trend? Legal responsibility for rumor.
Let’s not judge whether it’s true or not, but think about what we can do?
Using Python to predict merging
We can use numpy to solve polynomials and polynomial fitting in Python.
Try to use numpy’s polyfit function for fitting and drawing.
The code is as follows:
import matplotlib.pyplot as plt import numpy as np x = np.array([year for year in range(2009,2019)]) y = np.array([0.5,9.36,52,191,352,571,912,1207,1682.69,2135]) Z1 = NP. Polyfit (x, y, 3) ාාාාfitted with a cubic polynomial p1 = np.poly1d(z1) yvals=p1(x) Plot1 = PLT. Plot (x, y, '*', label = actual sales amount ') Plot2 = PLT. Plot (x, yvals, 'R', label = 'fit sales') PLT. Xlabel ('year ') PLT. Ylabel ('sales (100 million) PLT. Legend (LOC = 4) ා specify the location of legend PLT. Title ('2009-2018 Taobao double 11 sales fit curve ') plt.figure(figsize=(10, 10)) plt.show() Print ('fit polynomial: ', P1) × print fit polynomial p1 = np.poly1d(z1) print("-"*40) Print ('2019 forecast: ', P1 (2019)) print forecast
The data predicted by cubic polynomials are very similar to the published results.
Let’s get on with it.
Import 268.4 billion in 2019, and forecast the next three years:
According to online conspiracy theory, the data in the next few years should be like this.
After reading several articles on the Internet, there are different opinions.
As a technical Er, we will not evaluate it.
It’s enough to write only some data related to us.
What is the opinion of the Internet public on this matter?
Take a look at a vote sponsored by Tencent technology.
Public opinion is like this vote.