What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-27 14:10:11
keras preprocess_input
from tensorflow.keras.applications.resnet50 import ResNet50 from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.resnet50 import preprocess_input, decode_predictions import numpy as np model = ResNet50(weights='imagenet') ... Add solution -
Python 2022-03-01 23:20:01
zip function python 3
>>> numbers = [1, 2, 3] >>> letters = ['a', 'b', 'c'] >>> zipped = zip(numbers, letters) >>> zipped # Holds an iterator object <zip object at 0x7fa4831153c8> >>> type(zipped) <class 'zip'> >>... Add solution -
Python 2022-01-23 02:06:00
python bresenham line algorithm
def get_line(start, end): """Bresenham's Line Algorithm Produces a list of tuples from start and end >>> points1 = get_line((0, 0), (3, 4)) >>> points2 = get_line((3, 4), (0, 0)) >>> ass... Add solution -
Python 2022-01-22 17:15:32
python zip function
>>> numbers = [1, 2, 3] >>> letters = ['a', 'b', 'c'] >>> zipped = zip(numbers, letters) >>> zipped # Holds an iterator object <zip object at 0x7fa4831153c8> >>> type(zipped) <class 'zip'> >>... Add solution -
Python 2022-01-22 07:55:52
check string line python
def search_string_in_file(file_name, string_to_search): """Search for the given string in file and return lines containing that string, along with line numbers""" &n... Add solution -
Python 2021-11-21 19:03:18
python plot a dictionary
# credit to the Stack Overflow user in the source link import matplotlib.pylab as plt lists = sorted(d.items()) # sorted by key, return a list of tuples x, y = zip(*lists) # unpack a list of pairs into two tuples plt.plot(x, y) plt.show() Add solution -
Python 2021-10-09 11:41:07
python list of tuples
#List of Tuples list_tuples = [('Nagendra',18),('Nitesh',28),('Sathya',29)] #To print the list of tuples using for loop you can print by unpacking them for name,age in list_tuples: print(name,age) #To print with enumerate--->enumerate is nothing b... Add solution -
Python 2021-08-30 19:18:02
word search puzzle python
An improved (shorter, more efficient) version of the above: #!/usr/bin/python # -*- coding: utf-8 -*- puzzle='''F Y Y H N R D R L J C I N U A A W A A H R N T K L P N E C I L F S A P E O G O T P N H P O L A N D ''' clues = ['ITALY', 'HOLLAND'... Add solution