中级
实现素材下发优先级排序
未完成
中级参考
代码结构已给出,请填写 ____ 处
def solve():
from pyodide.http import open_url
from io import StringIO
import pandas as pd
crv_csv = open_url(____).read()
creatives = pd.read_csv(StringIO(____))
approved = creatives[creatives['____']=='____'].copy()
NET_FACTOR = {'____':____,'____':____,'____':____,'____':____}
def priority(____):
size_score = ____ / (float(____) + ____)
net_f = NET_FACTOR.get(____)
urg_b = ____ if urgent else ____
return round(____)
approved = approved.copy()
approved['____'] = approved.apply(lambda r: priority(____), axis=____)
sorted_q = approved.sort_values(____)
print(____)
for _, row in sorted_q.head(____).iterrows():
print("____"+row['____']+"____"+row['____']+"____"+str(round(____))+"____"+str(____))
示例
输入
solve()
期望输出
Download queue (top 8, net=good): CRV-0040 [JPG] size=0.2MB priority=0.6667 CRV-0058 [JPG] size=0.2MB priority=0.6504 CRV-0027 [PNG] size=0.3MB priority=0.6015 CRV-0075 [PNG] size=0.3MB priority=0.6015 CRV-0057 [PNG] size=0.4MB priority=0.5674 CRV-0117 [PNG] size=0.5MB priority=0.5442 CRV-0012 [JPG] size=0.5MB priority=0.5405 CRV-0064 [PNG] size=0.5MB priority=0.5229
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199