jyyx's recent timeline updates
jyyx

jyyx

V2EX member #452058, joined on 2019-11-09 17:53:07 +08:00
jyyx's recent replies
Dec 14, 2020
Replied to a topic by 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)
你的 pika 版本不是最新的吧, 更新到 1.1.0
Jun 19, 2020
Replied to a topic by 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
__class__ 看下是不是要这个
May 20, 2020
Replied to a topic by HashV2 程序员 v2 首贴,有些迷茫,请教一下各位
插个眼, 我现在也是差不多这个状态
递归那里没有返回, else 里面没有 return
改成 return get_http_ip()
@thinszx 我的就是你想要的吧, 本来 groupby 就可以切割了
for key, df_sub in df.groupby('A'):
print(key, df_sub)
list(df.groupby('a')) 是要这个吗?
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5772 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 42ms · UTC 07:20 · PVG 15:20 · LAX 00:20 · JFK 03:20
♥ Do have faith in what you're doing.