What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-25 00:05:02
matplotlib hist
import matplotlib.pyplot as plt data = [1.7,1.8,2.0,2.2,2.2,2.3,2.4,2.5,2.5,2.5,2.6,2.6,2.8, 2.9,3.0,3.1,3.1,3.2,3.3,3.5,3.6,3.7,4.1,4.1,4.2,4.3] #this histogram has a range from 1 to 4 #and 8 different bins plt.hist(data, range=(1,4), bins=8) plt... Add solution -
Python 2022-03-17 07:50:19
Highlighting the shortest path in a Networkx graph
import matplotlib.pyplot as plt G = nx.karate_club_graph() pos = nx.spring_layout(G) nx.draw(G,pos,node_color='k') # draw path in red path = nx.shortest_path(G,source=14,target=16) path_edges = zip(path,path[1:]) nx.draw_networkx_nodes(G,pos,nodelist=path... Add solution -
Python 2022-03-17 06:25:01
matplotlib embedded in tkinter
# Creates simple Graph embedded in tkinter import tkinter from tkinter import * import numpy as np from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from matplotlib.figure import Figure tkFenster = Tk() tkFenster.geom... Add solution -
Python 2022-03-12 07:00:02
how to find the labels of the confusion matrix in python
""" In order to find the labels just use the Counter function to count the records from y_test and then check row-wise sum of the confusion matrix. Then apply the labels to the corresponding rows using the inbuilt seaborn plot as shown b... Add solution