Rommy 最近的时间轴更新
Rommy

Rommy

V2EX 第 613716 号会员,加入于 2023-02-12 22:37:35 +08:00
今日活跃度排名 13315
Rommy 最近回复了
289 天前
回复了 JustW 创建的主题 分享发现 Google Bard 支持中文啦!
没找到图片识别
303 天前
回复了 ohayoo 创建的主题 Python 菜鸟又来求助 pandas 了
@cy1027 问个问题还要瞻前顾后,纠结是否优雅,这是学习该有的态度吗?另外,我就是太久没用 pandas ,看着有点兴致,试着写了下,写完分享一下。你如果是说我哪里写的不好,太粗糙,那我接受,但我觉得我的行为没啥可指摘的。最后,gpt 的实现依赖的是人与人之间的交流对话文本,这背后都是一个个特别基础的问题与回答,有啥可傲慢的?
304 天前
回复了 ohayoo 创建的主题 Python 菜鸟又来求助 pandas 了
import pandas as pd
import re
import pandas as pd

pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
pd.set_option('max_colwidth',100)

df1=pd.DataFrame({'id':[1,2],
'regions':['广东','上海'],
'isp':['电信','电信'],
'answers':['xxx.xxx.com.\nxxx.xxx.xxx.com.\n1.1.1.1 中国深圳电信\n2.2.2.2 中国深圳电信\n',
'xxx.xxx.com.\nxxx.xxx.xxx.com.\n3.3.3.3 中国上海电信\n4.4.4.4 中国上海电信\n']})

df2=pd.DataFrame({'Age':[13,0,20,25],
'ip':['1.1.1.1',
'2.2.2.2',
'3.3.3.3',
'4.4.4.4'],
'status_code':[200,403,200,200]})
for column in df2.columns:
df2[column]=df2[column].apply(str)

def ip_extract(input_string):
ip_pattern = r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
ip_addresses = re.findall(ip_pattern, input_string)
return '\n'.join(ip_addresses)
df1_new = df1.copy()
df1_new['ip'] = df1_new['answers'].apply(ip_extract)

df_ip = df1_new['ip'].str.split('\n',expand=True).stack().reset_index(level=1,drop=True).to_frame(name='ip')

df_merge = df1_new.drop(['ip'],axis=1).join(df_ip).merge(df2,on=['ip'])

def concat_func(x):
return pd.Series({column:'\n'.join(x[column]) for column in df2.columns})
df_group = df_merge.groupby(['answers']).apply(concat_func).reset_index()

df = df1.merge(df_group,on=['answers'])
print(df)
309 天前
回复了 amiwrong123 创建的主题 问与答 Zotero 如何折叠全部大纲?
@amiwrong123 那个是你下载的 pdf 文件决定的,不是默认全部展开的
310 天前
回复了 Rommy 创建的主题 微信 有人知道微信划线怎么屏蔽吗
@aitianci #8 Google Play 的 8.0.33 版
310 天前
回复了 Rommy 创建的主题 微信 有人知道微信划线怎么屏蔽吗
@opengps 这个划线是其他用户划的,不过公众号可以决定是否开启这个功能
310 天前
回复了 Rommy 创建的主题 微信 有人知道微信划线怎么屏蔽吗
316 天前
回复了 zsd6918 创建的主题 程序员 nobe 上的虚拟信用卡都被 openai 拒绝了
同样用的 nobepay 。续费成功一次,第二次续费没续上,换卡换 ip 始终没成功,最后重新创了个号用新卡直接成功。怀疑是之前那个号不小心用国内 ip 尝试调用了 api ,导致那个号被预警了。
第一个例子用 GPT-4 官方网页版没答上来。
https://chat.openai.com/share/aae38531-613a-4425-a709-8785817bf4ff
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   881 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 483ms · UTC 21:26 · PVG 05:26 · LAX 14:26 · JFK 17:26
Developed with CodeLauncher
♥ Do have faith in what you're doing.