IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Market Basket Analysis in Python

Visualizza il corso

Istruzioni dell'esercizio

  • 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.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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()
Modifica ed esegui il codice