例如,我有一个3列布局,其中包含代码。现在,当浏览器窗口变小时,它从顶部的第一列开始,从中间的第二列开始,然后按预期的最后第三列堆叠。我希望列变小时,列的这种行为。
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
a = {'year':[2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015],'y_true':[0,-0.174,-0.131,0.127,0.566,0.723,0.675,1.171,2.338,2.625,3.746,3.612,4.729,8.156,16.330,27.584]}
df = pd.DataFrame(a)
x = np.array(df['year']).reshape(-1,1)
y_true = df['y_true']
linear_reg = LinearRegression().fit(x,y_true)
y_pred = linear_reg.predict(x)
df['y_pred'] = y_pred
df['difference'] = y_true - y_pred
print(df)
答案 0 :(得分:0)
使用.order-
类来控制内容的视觉顺序。
<div class="container">
<div class="row">
<div class="col-sm-3">
First, but unordered
</div>
<div class="col-sm-6 order-12">
Second, but last
</div>
<div class="col-sm-3 order-1">
Third, but first
</div>
</div>
</div>