小宇啊
小宇啊
全部文章
分类
归档
标签
去牛客网
登录
/
注册
小宇啊的博客
全部文章
(共111篇)
题解 | #牛客网用户等级的中位数#
import pandas as pd df = pd.read_csv('Nowcoder.csv') print(int(df.query("Num_of_exercise >= 10")['Level'].median()))
2024-09-13
0
74
题解 | #Python用户的平均提交次数#
import pandas as pd df = pd.read_csv('Nowcoder.csv') avg_cnt = df.query("Language == 'Python'")['Number_of_submissions'].mean() print(avg_...
2024-09-13
0
92
题解 | #输出提交且通过次数大于2 的用户ID且升序排列#
select t.user_id from (select user_id, sum(result_info) as pass_cnt from done_questions_record group by ...
2024-08-28
0
93
题解 | #查询用户刷题日期和下一次刷题日期#
select user_id, date, lead(date) over(partition by user_id order by date) as nextdate from questions_pass_record order by user_id...
2024-08-28
0
120
题解 | #查询每天刷题通过数最多的前二名用户id和刷题数#
select t.date, t.user_id, t.pass_count from (select date, user_id, pass_count, row_number() over(parti...
2024-08-28
0
95
题解 | #分群并计算群体人数#
select case when age < 20 then '20以下' when age between 20 and 50 then '20-50' when age > 50 then '50以上' else '未填写' ...
2024-08-28
0
84
题解 | #判断其是否有过购买记录#
select customer_id, case when latest_place_order_date is not null then 1 else 0 end as if_placed_order from customers_info
2024-08-28
0
102
题解 | #查询职位发布时间在2021年后或职位城市为上海
select tmp.job_id, tmp.boss_id, tmp.company_id from (select a.job_id, a.boss_id, a.company_id, a.job_c...
2024-08-28
0
109
题解 | #日活次日留存率和新户次日留存率#
With Login_Tb AS ( select a.uid, a.login_date, case when a.login_date = b.first_login_date then 'new' else 'old' end as l...
2024-08-28
0
102
题解 | #计算每天的新用户占比#
select tmp.login_date as dt, count(distinct tmp.uid) as total_user_num, concat(format(round(sum(case when user_type = 'new' then 1 else 0 ...
2024-08-27
0
115
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页