We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a directed graph that relates the actors Brad Pitt, Eva Green, George Clooney, Catherine Zeta-Jones, Johnny Depp, and Helena Bonham Carter to the following movies: Ocean's Twelve, Fight Club, Dark Shadows.
The text was updated successfully, but these errors were encountered:
from networkx import DiGrapgh my_graph = DiGrapgh() my_graph.add_node("Brad Pitt") my_graph.add_node("Eva Green") my_graph.add_node("George Clooney") my_graph.add_node("Catherine Zeta-Jones") my_graph.add_node("Johnny Depp") my_graph.add_node("Helena Bonham Carter") my_graph.add_node("Ocean's Twelve") my_graph.add_node("Fight Club") my_graph.add_node("Dark Shadows") my_graph.add_edge("Brad Pitt", "Ocean's Twelve") my_graph.add_edge("George Clooney", "Ocean's Twelve") my_graph.add_edge("Catherine Zeta-Jones", "Ocean's Twelve") my_graph.add_edge("Brad Pitt", "Fight Club") my_graph.add_edge("Helena Bonham Carter", "Fight Club") my_graph.add_edge("Helena Bonham Carter", "Dark Shadows") my_graph.add_edge("Johnny Depp", "Dark Shadows") my_graph.add_edge("Eva Green", "Dark Shadows")
Sorry, something went wrong.
from networkx import DiGraph movie_graph = DiGraph() movie_graph.add_node("Brad Pitt") movie_graph.add_node("Eva Green") movie_graph.add_node("George Clooney") movie_graph.add_node("Catherine Zeta-Jones") movie_graph.add_node("Johnny Depp") movie_graph.add_node("Helena Bonham Carter") movie_graph.add_node("Ocean's Twelve") movie_graph.add_node("Fight Club") movie_graph.add_node("Dark Shadows") movie_graph.add_edge("George Clooney", "Ocean's Twelve") movie_graph.add_edge("Brad Pitt", "Ocean's Twelve") movie_graph.add_edge("Catherine Zeta-Jones", "Ocean's Twelve") movie_graph.add_edge("Brad Pitt", "Fight Club") movie_graph.add_edge("Helena Bonham Carter", "Fight Club") movie_graph.add_edge("Johnny Depp", "Dark Shadows") movie_graph.add_edge("Helena Bonham Carter", "Dark Shadows") movie_graph.add_edge("Eva Green", "Dark Shadows")
I've also tried to visualize it using matplotlib and this is the result:
No branches or pull requests
Create a directed graph that relates the actors Brad Pitt, Eva Green, George Clooney, Catherine Zeta-Jones, Johnny Depp, and Helena Bonham Carter to the following movies: Ocean's Twelve, Fight Club, Dark Shadows.
The text was updated successfully, but these errors were encountered: