小编Mat*_*hew的帖子

尝试运行基本 Apache Beam Pipeline 时出现“AttributeError: type object 'Series' has no attribute 'append'”

Beam Code 可在 Google Collab 中运行,但无法在我自己的 jupyter 笔记本上运行 - 也许与 Pandas 2.0.0 有关?任何帮助将非常感激。

我正在尝试学习 Apache Beam,我尝试根据Cloud AI 和 Analytics 频道的教程创建一个基本管道。

这是代码:

import apache_beam as beam
grocery = (p1
| "Read From Text" \>\> beam.io.ReadFromText(file, skip_header_lines=1)
| "Convert to uppercase" \>\> beam.Map(lambda record: record.upper())
| 'Write to Text' \>\> beam.io.WriteToText('/concent/grocery_upper.txt'))
Run Code Online (Sandbox Code Playgroud)

此代码适用于 Google Collaboratory,但不适用于我本地的 Jupyter Notebook。

相反,我收到此错误:

"name": "AttributeError",
"message": "type object 'Series' has no attribute 'append'",
Run Code Online (Sandbox Code Playgroud)

完整错误消息:

"stack": "\\u001b\[0;31m---------------------------------------------------------------------------\\u001b\[0m\\n\\u001b\[0;31mAttributeError\\u001b\[0m                           
 Traceback (most recent call last)\\nCell \\u001b\[0;32mIn\[14\], line 21\\u001b\[0m\\n\\u001b\[1;32m     19\\u001b\[0m \\u001b\[39mimport\\u001b\[39;00m …
Run Code Online (Sandbox Code Playgroud)

python beam pandas

2
推荐指数
1
解决办法
1267
查看次数

标签 统计

beam ×1

pandas ×1

python ×1