jyyx 最近的时间轴更新
jyyx

jyyx

V2EX 第 452058 号会员,加入于 2019-11-09 17:53:07 +08:00
jyyx 最近回复了
2020 年 12 月 14 日
回复了 Scorpiocat 创建的主题 Python pandas 操作求助,数据如下
df = pd.DataFrame({'月':['1','2','3','5','7'],
'医院':['人民','二院','人民','二院','人民'],
'销量':np.arange(1,10,2) })
month_list = ['1','2','3','4','5','6','7','8']
df['月'] = df['月'].astype('category').cat.set_categories(month_list, ordered=True)
gb = df.groupby(['医院','月']).sum().fillna(0)
print(gb)
2020 年 11 月 26 日
回复了 kaka6 创建的主题 Python python3.7 引用三方库 pika,出现关键字冲突: self.async = None
你的 pika 版本不是最新的吧, 更新到 1.1.0
2020 年 6 月 19 日
回复了 jeeyong 创建的主题 Python 通过 cmd 执行 Python 脚本会卡主,没有报错.
开启了快速编辑模式? 关闭试下
其实获取 index 不需要用 loc 了
mask = (df_new.index >= df_new['low'].idxmin()) & (df_new['mark'] == -1)
mask.head(1).index
mask = (df_new.index >= df_new['low'].idxmin()) & (df_new['mark'] == -1)
new_df.loc[mask, :].head(1).index
2020 年 5 月 22 日
回复了 YOUMA 创建的主题 Python 请问怎样在静态方法中获得当前调用的上下文?
__class__ 看下是不是要这个
2020 年 5 月 20 日
回复了 HashV2 创建的主题 程序员 v2 首贴,有些迷茫,请教一下各位
插个眼, 我现在也是差不多这个状态
2020 年 4 月 21 日
回复了 smallgoogle 创建的主题 Python Python 变量赋值 没有成功,偶发性现象 诡异
递归那里没有返回, else 里面没有 return
改成 return get_http_ip()
@thinszx 我的就是你想要的吧, 本来 groupby 就可以切割了
for key, df_sub in df.groupby('A'):
print(key, df_sub)
list(df.groupby('a')) 是要这个吗?
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1210 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 17:48 · PVG 01:48 · LAX 09:48 · JFK 12:48
♥ Do have faith in what you're doing.