0

In the Databricks visualization reference it states

PySpark, pandas, and koalas DataFrames have a display method that calls the Databricks display function. You can call it after a simple DataFrame operation

with example

diamonds_df = spark.read.csv("/databricks-datasets/Rdatasets/data-001/csv/ggplot2/diamonds.csv", header="true", inferSchema="true")
diamonds_df.select("color","price").display()

but when I try the same in my databricks cluster I get the error

AttributeError: 'DataFrame' object has no attribute 'display'

Need help why I am gettin the error, I did all the same mentioned in the visulaization reference.

3
  • Are you trying this one on the Databricks notebook? Commented Aug 18, 2020 at 12:40
  • 1
    or .display() will work only for Available in Databricks Runtime 7.1 and above. Commented Aug 18, 2020 at 12:41
  • Okay, saw that but didn't knew I was using default databricks runtime 6.5. Thanks @Lamanus Commented Aug 18, 2020 at 12:50

2 Answers 2

2

according to the documentation:

display(diamonds_df.select("color","price"))
Sign up to request clarification or add additional context in comments.

1 Comment

I know this works, I wanted to know why did above code gave error which I found out that it was because of Databricks runtime version. Hence not accepting the answer
0

It was because of Databricks Runtime version which was not supported, as mentioned by @lamanus

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.