Python Code Samples



Filters


Python logging basic example to print from debug
kishore_kumar | 6 years
import logging
logging.basicConfig(level=logging.DEBUG)

python logging
round a floating point number in python
kishore_kumar | 6 years, 9 months
my_number = 123.83725

print round(my_number, 2) # 123.84
python
unzip file from gz files using python
kishore_kumar | 5 years, 11 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 | 6 years, 1 month
import pandas as pd
data = [{'Python': 90, 'C': 84,'java':65},{'Python': 78, 'C': 90, 'java': 65}]
python pandas dataframe
Text identification in the image using google vision API with python
kishore_kumar | 6 years, 5 months
from google.cloud import vision
from google.cloud.vision import types

python google vision
Python pickle dump
Reshma | 5 years, 9 months
import pickle

number_of_data = int(input('Enter the number of data : '))
python pickle dump
Save full traceback from exception in python
kishore_kumar | 5 years, 12 months
import traceback

l = [1,2,3]
python exception
how to log full traceback using python logging
kishore_kumar | 5 years, 12 months
import logging
  
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', datefmt=
python logging
durga
Writing into files in python
durga | 6 years, 1 month
file = open('open.txt','w') 
 
file.write('Hi there!') 
python file handling
python base64 encode and decode a string
kishore_kumar | 6 years, 2 months
import base64

str1 = "koderplace"
python base64
Prev Next