Python Code Samples



Filters


Python get last working day of the month
kishore_kumar | 3 years
from datetime import datetime
import calendar

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

python google vision
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, 1 month
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, 2 months
import logging
logging.basicConfig(level=logging.DEBUG)

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

python django django-orm
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
convert string to python datetime object
kishore_kumar | 5 years, 3 months
import datetime

st = "2019-08-19 05:40"
python datetime
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
python base64 encode and decode a string
kishore_kumar | 5 years, 4 months
import base64

str1 = "koderplace"
python base64
Prev Next