Python Code Samples



Filters


Text identification in the image using google vision API with python
kishore_kumar | 6 years
from google.cloud import vision
from google.cloud.vision import types

python google vision
round a floating point number in python
kishore_kumar | 6 years, 4 months
my_number = 123.83725

print round(my_number, 2) # 123.84
python
Python logging basic example to print from debug
kishore_kumar | 5 years, 7 months
import logging
logging.basicConfig(level=logging.DEBUG)

python logging
unzip file from gz files using python
kishore_kumar | 5 years, 6 months
import gzip
import shutil
with gzip.open('my_file.gz', 'rb') as f_in:
python gzip
Ramya
Indexed DataFrame using list of dictionaries
Ramya | 5 years, 8 months
import pandas as pd
data = [{'Python': 90, 'C': 84,'java':65},{'Python': 78, 'C': 90, 'java': 65}]
python pandas dataframe
Simple singly Linked List in python
kishore_kumar | 6 years, 1 month
class Node(object):
    def __init__(self, data=None, next_node=None):
        self.data = data
python linked list
python base64 encode and decode a string
kishore_kumar | 5 years, 9 months
import base64

str1 = "koderplace"
python base64
Save full traceback from exception in python
kishore_kumar | 5 years, 7 months
import traceback

l = [1,2,3]
python exception
get all keys from redis with python
kishore_kumar | 5 years, 4 months
import redis # pip install redis
r = redis.Redis(host='localhost', port='6379')

python redis
How to load a pickle file in python
harika | 5 years, 6 months
with open('train.pickle', 'rb') as f:
    X_train, y_train = pickle.load(f)
python pickle file
Prev Next