LoslegenKostenlos loslegen

Refining a parallel coordinates plot

After viewing your parallel coordinates plot, the founder concludes that her decision to step away from a Batman-centered streaming platform may have been premature. Indeed, the parallel coordinates plot seems to suggest that many popular movies are strongly associated with The Dark Knight. She decides instead to pitch the idea to her staff in a meeting, but has asked you to make some refinements to the plot to make it more visually appealing for the presentation.

Note that the rules have been generated and are available for you as rules. Additionally, pandas is available as pd and the function rules_to_coordinates() has been defined and is available.

Diese Übung ist Teil des Kurses

Market Basket Analysis in Python

Kurs anzeigen

Anleitung zur Übung

  • Import the parallel coordinates function from the plotting submodule of pandas.
  • Convert the DataFrame of rules into coordinates.
  • Complete the statement to generate a parallel coordinates plot, using ocean as the colormap.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Import the parallel coordinates plot submodule
from pandas.____ import parallel_coordinates

# Convert rules into coordinates suitable for use in a parallel coordinates plot
coords = ____

# Generate parallel coordinates plot
____(____, 'rule', colormap = '____')
plt.legend([])
plt.show()
Code bearbeiten und ausführen