我正在尝试为所有卡放置相同大小的图像,但是有些图像的高度已经很小,那么该如何解决呢?
<div class="row">
<div class="col">
<div class="card h-100" style="width: 18rem;">
<img class="card-img-top" src="/assets/prewedding/pic1.jpg">
</div>
</div>
<div class="col">
<div class="card h-100" style="width: 18rem;">
<img class="card-img-top" src="/assets/prewedding/pic2.jpg">
</div>
</div>
</div>
答案 0 :(得分:0)
您只需要设置from pandas import DataFrame
df = DataFrame([
{"User": "User1", "Action": "A", "id": 1},
{"User": "User1", "Action": "B", "id": 2},
{"User": "User1", "Action": "B", "id": 3},
{"User": "User1", "Action": "C", "id": 4},
{"User": "User1", "Action": "C", "id": 5},
{"User": "User1", "Action": "C", "id": 6},
{"User": "User2", "Action": "A", "id": 7},
{"User": "User2", "Action": "B", "id": 8},
{"User": "User2", "Action": "B", "id": 9},
{"User": "User2", "Action": "C", "id": 10},
{"User": "User2", "Action": "C", "id": 11},
{"User": "User2", "Action": "C", "id": 12},
{"User": "User3", "Action": "A", "id": 13},
{"User": "User3", "Action": "B", "id": 14},
{"User": "User3", "Action": "B", "id": 15},
{"User": "User3", "Action": "C", "id": 16},
{"User": "User3", "Action": "C", "id": 17},
])
print(df)
df_agg = df.groupby(["Action", "User"]).agg({"id": ["count"]})
print(df_agg)
df_result = DataFrame([
{"Action": "A", "Mean usage per user": 1},
{"Action": "B", "Mean usage per user": 2},
{"Action": "C", "Mean usage per user": 8 / 3},
])
print(df_result)
即可覆盖容器,例如
img