What do you want to save?
Add Code snippet
New code examples
-
Other 2022-02-01 22:36:47
fibonacci sphere python
from numpy import pi, cos, sin, arccos, arange import mpl_toolkits.mplot3d import matplotlib.pyplot as pp num_pts = 1000 indices = arange(0, num_pts, dtype=float) + 0.5 phi = arccos(1 - 2*indices/num_pts) theta = pi * (1 + 5**0.5) * indices x, y, z = c... Add solution -
Python 2022-02-01 14:12:26
k means clustering python medium
import pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport numpy as np# read data into variable Iris_dataIris_data = pd.read_csv("D:\ProjectData\Iris.csv")#display first few rows of dataIris_data.head() Add solution -
Python 2022-01-29 09:26:37
k-means
import tkinter as tk from tkinter import filedialog import pandas as pd from pandas import DataFrame import matplotlib.pyplot as plt from sklearn.cluster import KMeans from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg root= tk.Tk() canvas1... Add solution -
Python 2022-01-29 07:42:13
Image to grayscale using python
import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg def rgb2gray(rgb): return np.dot(rgb[...,:3], [0.299, 0.587, 0.144]) img = mpimg.imread('img.png') gray = rgb2gray(img) plt.imshow(gray, cmap='gray') plt.savefig(... Add solution -
Python 2022-01-28 22:55:46
hierarchical clustering dendrogram python example
from scipy.cluster.hierarchy import dendrogram, linkage from matplotlib import pyplot as plt linked = linkage(X, 'single') labelList = range(1, 11) plt.figure(figsize=(10, 7)) dendrogram(linked, orientation='top', labels=labelLi... Add solution