What do you want to save?
Add Code snippet
New code examples
-
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 -
Other 2022-03-16 23:45:06
Three-dimensional Points and Lines
ax = plt.axes(projection='3d') # Data for a three-dimensional line zline = np.linspace(0, 15, 1000) xline = np.sin(zline) yline = np.cos(zline) ax.plot3D(xline, yline, zline, 'gray') # Data for three-dimensional scattered points zdata = 15 * np.random.r... Add solution -
Python 2022-03-13 04:10:03
Circular heatmap python
from pylab import * import numpy as np from scipy.interpolate import griddata #create 5000 Random points distributed within the circle radius 100 max_r = 100 max_theta = 2.0 * np.pi number_points = 5000 points = np.random.rand(number_points,2)*[max_r,max... 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