【发布时间】:2020-09-26 04:56:00
【问题描述】:
koalas_img = ks.read_spark_io(path="/mnt/databricks/demo/CarClassification/cars_train/009*.jpg", format="binaryfile")
koalas_img.shape
Out[16]: (100, 4)
type(koalas_img)
Out[17]: databricks.koalas.frame.DataFrame
koalas_img.columns
Out[18]: Index(['path', 'modificationTime', 'length', 'content'], dtype='object')
koalas_img.iloc[0]
SparkPandasNotImplementedError: .iloc requires numeric slice or conditional boolean Index, got [0] You are trying to use pandas function .iloc[..., ...], use spark function select, where
根据https://databricks.com/notebooks/cnn-car-class/koalas-augmentation.html 中的文档 iloc 函数可以与 koalas 数据框一起使用。
【问题讨论】:
-
嗨@nimit Kothari,如果我的回答对您有帮助,您可以接受它作为答案(单击答案旁边的复选标记将其从灰色切换为已填充。)。这对其他社区成员可能是有益的。谢谢。
标签: python pyspark apache-spark-sql databricks spark-koalas