如果我有列数据,例如100个条目属于两种格式;在列名URL下:
http//mysportswebsite.com/shop/?Baseball+Bat=5
http//memoribilia.com/checkout?autograph=1
如何提取购买的商品和编号?你知道吗
理想情况下,我想添加新的列(如果它们还不存在)在这个例子棒球棒和签名,然后添加各自的计数5和1到他们的列(或只是添加到列,如果他们存在从前面的例子),从这个数据推断购买计数。你知道吗
我想对python中的整个URL列执行此操作
Tags:
对于这个问题(信息有限),我建议:
如果您的df如下所示:
你可以这样做:
结果是:
下面是另一种使用
re
模块的方法:Python已经有了解析url的库。你知道吗
相关问题 更多 >
编程相关推荐