在发票上查看哪些物品一起出售

发布于 2025-02-01 00:16:56 字数 710 浏览 4 评论 0原文

我正在使用 python

我正在使用 CSV

我正在使用 pandas.dataframe

我喜欢1.000.000发票。

发票具有以下格式:

发票1:

  • 苹果

发票2:

  • 猕猴桃
  • 橘皮
  • 菠萝

发票3:

  • melon
  • 西瓜

...

我想要为此:

通常以:

  • 苹果
  • 橙色
  • 瓜 - 水上

有任何有效的到达那里的方法吗?

提前致谢。

I am working with python.

I am working with csv.

I am working with pandas.DataFrame.

I have like 1.000.000 invoices.

The invoices have the following format:

Invoice 1:

  • Pear
  • apple
  • orange

Invoice 2:

  • kiwi
  • tangerine
  • pineapple

Invoice 3:

  • melon
  • Pear
  • watermelon

...

I want to get this:

Pear

is usually sold with:

  • apple
  • orange
  • melon
    -watermelon

Any efficient way to get there?

Thanks in advance.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

差↓一点笑了 2025-02-08 00:16:56

这称为市场篮分析。

Python软件包mlxtend.frequent_patterns可以为您做到这一点。

有许多文章向您展示了如何做到这一点,以下是这样有用的文章:
https://pbpython.com/market-basket-basket-analysis.html

This is called market basket analysis.

Python package mlxtend.frequent_patterns can do this for you.

There are numerous articles that show you how to do this, below is one such useful one:
https://pbpython.com/market-basket-analysis.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文