【发布时间】:2020-01-21 04:40:36
【问题描述】:
我在 Databricks 上不断收到以下错误:
SparkPandasNotImplementedError: .iloc requires numeric slice or conditional boolean Index, got You are trying to use pandas function .iloc[..., ...], use spark function select, where
这是我的代码:
import re
import nltk
import heapq
corpus = []
for i in range(0, len(Y)):
describe = re.sub('[^a-zA-Z]', ' ', Y.iloc[i, 0])
describe = describe.lower()
describe = describe.split()
describe = ' '.join(describe)
corpus.append(describe)
代码在 Spyder 中运行良好,但在数据块中却不行。
【问题讨论】:
标签: python pandas error-handling apache-spark-sql databricks