Python Code Samples



Filters


Using python generator for finding factors
kishore_kumar | 6 years, 4 months
def get_factors(num):
    i = 1
    while i * i < num:
python generator factors
Python pickle dump
Reshma | 6 years
import pickle

number_of_data = int(input('Enter the number of data : '))
python pickle dump
round a floating point number in python
kishore_kumar | 7 years
my_number = 123.83725

print round(my_number, 2) # 123.84
python
how to log full traceback using python logging
kishore_kumar | 6 years, 3 months
import logging
  
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', datefmt=
python logging
unzip file from gz files using python
kishore_kumar | 6 years, 2 months
import gzip
import shutil
with gzip.open('my_file.gz', 'rb') as f_in:
python gzip
Text identification in the image using google vision API with python
kishore_kumar | 6 years, 8 months
from google.cloud import vision
from google.cloud.vision import types

python google vision
Ramya
Indexed DataFrame using list of dictionaries
Ramya | 6 years, 4 months
import pandas as pd
data = [{'Python': 90, 'C': 84,'java':65},{'Python': 78, 'C': 90, 'java': 65}]
python pandas dataframe
Save full traceback from exception in python
kishore_kumar | 6 years, 3 months
import traceback

l = [1,2,3]
python exception
Simple singly Linked List in python
kishore_kumar | 6 years, 9 months
class Node(object):
    def __init__(self, data=None, next_node=None):
        self.data = data
python linked list
durga
Writing into files in python
durga | 6 years, 4 months
file = open('open.txt','w') 
 
file.write('Hi there!') 
python file handling
Prev Next