Python Code Samples



Filters


Ramya
Indexed DataFrame using list of dictionaries
Ramya | 7 years, 4 months
import pandas as pd
data = [{'Python': 90, 'C': 84,'java':65},{'Python': 78, 'C': 90, 'java': 65}]
python pandas dataframe
round a floating point number in python
kishore_kumar | 7 years, 12 months
my_number = 123.83725

print round(my_number, 2) # 123.84
python
Text identification in the image using google vision API with python
kishore_kumar | 7 years, 7 months
from google.cloud import vision
from google.cloud.vision import types

python google vision
unzip file from gz files using python
kishore_kumar | 7 years, 1 month
import gzip
import shutil
with gzip.open('my_file.gz', 'rb') as f_in:
python gzip
convert python date time object to specific format using strftime
kishore_kumar | 7 years, 3 months
import datetime

st = "2019-08-19 05:40"
python datetime
durga
Writing into files in python
durga | 7 years, 4 months
file = open('open.txt','w') 
 
file.write('Hi there!') 
python file handling
Remove directory / folder in python
harika | 7 years, 9 months
'''
You can remove empty directory by rmdir function.
But to remove non empty directory we have to
Shuttle : A module that offers a number of high-level operations on files and collections of files.
shutil python os
Simple singly Linked List in python
kishore_kumar | 7 years, 9 months
class Node(object):
    def __init__(self, data=None, next_node=None):
        self.data = data
python linked list
Save full traceback from exception in python
kishore_kumar | 7 years, 2 months
import traceback

l = [1,2,3]
python exception
python base64 encode and decode a string
kishore_kumar | 7 years, 4 months
import base64

str1 = "koderplace"
python base64
Prev Next