Python Code Samples



Filters


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

python google vision
Python get last working day of the month
kishore_kumar | 2 years, 11 months
from datetime import datetime
import calendar

python datetime
round a floating point number in python
kishore_kumar | 5 years, 11 months
my_number = 123.83725

print round(my_number, 2) # 123.84
python
unzip file from gz files using python
kishore_kumar | 5 years
import gzip
import shutil
with gzip.open('my_file.gz', 'rb') as f_in:
python gzip
Python logging basic example to print from debug
kishore_kumar | 5 years, 1 month
import logging
logging.basicConfig(level=logging.DEBUG)

python logging
How to combine two query sets in Django ORM
kishore_kumar | 5 years, 1 month
q1 = Task.objects.filter(id__lt=4)
q2 = Task.objects.filter(completed=True)

python django django-orm
Simple singly Linked List in python
kishore_kumar | 5 years, 8 months
class Node(object):
    def __init__(self, data=None, next_node=None):
        self.data = data
python linked list
Ramya
Indexed DataFrames using Arrays
Ramya | 5 years, 3 months
import pandas as pd
data = {'Subject':['Maths', 'Science', 'English'],'Marks':[70,80,90]}
df = pd.
python pandas dataframe
python base64 encode and decode a string
kishore_kumar | 5 years, 3 months
import base64

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

l = [1,2,3]
python exception
Prev Next