What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-27 11:30:13
tensorboardx
# demo.py import torch import torchvision.utils as vutils import numpy as np import torchvision.models as models from torchvision import datasets from tensorboardX import SummaryWriter resnet18 = models.resnet18(False) writer = SummaryWriter() sample_ra... Add solution -
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-19 17:05:11
ggplot2 histogram
library(ggplot2) # Basic histogram ggplot(df, aes(x=weight)) + geom_histogram() # Change the width of bins ggplot(df, aes(x=weight)) + geom_histogram(binwidth=1) # Change colors p<-ggplot(df, aes(x=weight)) + geom_histogram(color="black"... Add solution -
Python 2022-02-28 01:00:27
how to periodically update dash
import time from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor import dash import dash_html_components as html import dash_core_components as dcc import plotly.graph_objs as go import numpy as np # number of seconds between re-calcul... Add solution -
Python 2022-02-15 06:30:11
find most used colors in image python
from __future__ import print_function import binascii import struct from PIL import Image import numpy as np import scipy import scipy.misc import scipy.cluster NUM_CLUSTERS = 5 print('reading image') im = Image.open('image.jpg') im = im.resize((150, 15... Add solution -
Python 2022-02-02 22:11:23
matplotlib histogram python
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 -
Other 2021-11-19 06:16:26
QuantumCircuit: can be thought as the instructions of the quantum system. It holds all your quantum operations. QasmSimulator: is the Aer high performance circuit simulator. plot_histogram: creates histograms.
import numpy as np from qiskit import QuantumCircuit from qiskit.providers.aer import QasmSimulator from qiskit.visualization import plot_histogram Add solution -
Other 2021-11-16 20:09:24
ggplot2 overlapping histograms
ggplot(histogram, aes(f0)) + geom_histogram(data = lowf0, fill = "red", alpha = 0.2) + geom_histogram(data = mediumf0, fill = "blue", alpha = 0.2) + geom_histogram(data = highf0, fill = "green", alpha = 0.2) + Add solution