尝试按照显示的图像进行布局。
我获得了大部分布局权利,只是被顶部弧形夹卡住了。
尝试代码:
df1 = df[df.groupby('user_id')['question_id'].transform('size') > 100]
np.random.seed(123)
N = 1000000
L = list('abcde')
df = pd.DataFrame({'question_id': np.random.choice(L, N, p=(.75,.0001,.0005,.0005,.2489)),
'user_id':np.random.randint(10000,size=N)})
df = df.sort_values(['user_id','question_id']).reset_index(drop=True)
In [176]: %timeit df[df.groupby('user_id')['question_id'].transform('size') > 100]
74.8 ms ± 2.69 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
#coldspeed solutions
In [177]: %timeit df.groupby('user_id').filter(lambda x: len(x) > 100)
1.4 s ± 44.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
In [178]: %%timeit
...: m = dict(zip(*np.unique(df.user_id, return_counts=True)))
...: df[df['user_id'].map(m) > 100]
...:
89.2 ms ± 3.6 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
类代码:
ClipPath(
clipper: new DialogonalClipper(),
child: Container(
padding: const EdgeInsets.all(50.0),
child: Text(
"Sign Up",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 35.0,
fontStyle: FontStyle.normal,
color: Colors.white,
),
),
color: const Color(0xFF6d27ff),
//color: const Color(0xFF582dff),
height: 150.0,
),
),