大数据帧枢轴表

发布于 2025-02-10 08:38:55 字数 503 浏览 3 评论 0原文

我正在尝试为PABDAS DataFrame制作一个枢轴表,该数据框架的行动范围超过3000万行。

这是我的dataframe pic:

“这是我的dataframe

我正在尝试以下pivot_table()为此:

fundos_bd = bd.pivot_table(index='DT_COMPTC', columns='CNPJ_FUNDO', values='VL_QUOTA')

它有效,但没有处理来自数据框的所有数据。枢纽表上的许多行返回值。

一个描述的示例:

这里的 >(在上图上)从我的数据框架中旋转它,它可以按照应有的方式工作。

尝试的groupby()函数,但也没有起作用。

I am trying to make a pivot table for a Pabdas Dataframe that has more then 30 millions rows.

Here is my dataframe pic:

Here is my dataframe pic

I am trying the following pivot_table() for it:

fundos_bd = bd.pivot_table(index='DT_COMPTC', columns='CNPJ_FUNDO', values='VL_QUOTA')

It works but it doesn't process all data from the dataframe. Lots of rows on the pivoted table return None values.

Here an example of the described:

Here an example of the described

If I take just the same CNPJ_FUNDO (on the picture above) from my dataframe and pivot it it works as it should.

Tried groupby() function but it didn't work either.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文