Python中文
首页
教程
问答
标签
搜索
登录
注册
数据帧列中的计数列表长度
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>这是我的数据帧:</p> <pre><code>CustomerID InvoiceNo 0 12346.0 [541431, C541433] 1 12347.0 [537626, 542237, 549222, 556201, 562032, 57351] 2 12348.0 [539318, 541998, 548955, 568172] 3 12349.0 [577609] 4 12350.0 [543037] </code></pre> <p>期望输出:</p> <pre><code> CustomerID InvoiceCount 0 12346.0 2 1 12347.0 6 2 12348.0 4 3 12349.0 1 4 12350.0 1 </code></pre> <p>我想计算客户(CustomerID)拥有的发票总数。 请帮忙</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>如果在列表中,可以使用函数“len”</p> <p>假设列表在变量值中:</p> <pre><code>values = [537626, 542237, 549222, 556201, 562032, 57351] </code></pre> <p>那么金额是:</p> <pre><code>len(values) # 6 </code></pre> <p>在本例中,这将返回6</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何将python输出重定向到python控制台和Windows中的文本文件
5 回答
如何将Python运行时嵌入运行在Windows上的R包中
8 回答
如何将python进程作为另一个Windows us运行
9 回答
如何将Python进程的输出用Python管道传输?
6 回答
如何将Python进程的输出重定向到Rust进程?
2 回答
如何将python连接到Azure云并创建Azure数据工厂
10 回答
如何将Python连接到Db2
3 回答
如何将python连接到IBMDB2?
7 回答
如何将Python连接到microsoftaccess数据库文件?
1 回答
如何将python连接到MySQL服务器
7 回答
如何将Python连接到Node.js?
3 回答
如何将python连接到Oracle Application Express
8 回答
如何将Python连接到PostgreSQL
7 回答
如何将Python连接到Postgres服务器?
6 回答
如何将Python连接到SAS Enterprise Guide(EG)服务器
3 回答
如何将Python连接到Spark会话并保持RDDs的Ali
8 回答
如何将python连接到sqlite3并在上填充多行
4 回答
如何将python连接到使用docker运行的cassandra
10 回答
如何将python退格应用于字符串
2 回答
如何将python逻辑应用到tkinter GUI中?这是一个简单的GET请求程序
7 回答