ricardo_portill
Databricks Employee
Databricks Employee

Hi @sdaza,

You can use the display command to display objects such as a matplotlib figure or Spark data frames, but not a pandas data frame. Below is code to do this using matplotlib. Within Databricks, you can also import your own visualization library and display images using native library commands (like bokeh or ggplots displays, for example). See an example here: https://docs.databricks.com/user-guide/visualizations/bokeh.html

import numpy as np import pandas as pd

create dummy pandas data frame for visualization

y_data = np.array([[5, 1], [3, 3], [1, 2], [3, 1], [4, 2], [7, 1], [7, 1]])

import matplotlib.pyplot as plt

x = my_data[:,0] y = my_data[:,1]

extract subplots from the data points

ig, ax = plt.subplots() ax.plot(x, y)

Display the matplotlib Figure object to render our pandas data frame

isplay(fig)