Python Code Samples



Filters


Generate Pie Chart in python using matplotlib
kishore_kumar | 6 years, 11 months
import matplotlib.pyplot as plt

labels = 'Grapes', 'Oranges', 'Mangoes', 'Apples'
python matplotlib
round a floating point number in python
kishore_kumar | 6 years, 11 months
my_number = 123.83725

print round(my_number, 2) # 123.84
python
Python pickle dump
Reshma | 5 years, 10 months
import pickle

number_of_data = int(input('Enter the number of data : '))
python pickle dump
how to log full traceback using python logging
kishore_kumar | 6 years, 1 month
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
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, 3 months
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, 6 months
from google.cloud import vision
from google.cloud.vision import types

python google vision
Save full traceback from exception in python
kishore_kumar | 6 years, 1 month
import traceback

l = [1,2,3]
python exception
Simple singly Linked List in python
kishore_kumar | 6 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 | 6 years, 3 months
import base64

str1 = "koderplace"
python base64
Prev Next