Python Code Samples



Filters


Simple singly Linked List in python
kishore_kumar | 6 years, 2 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, 10 months
import base64

str1 = "koderplace"
python base64
Save full traceback from exception in python
kishore_kumar | 5 years, 7 months
import traceback

l = [1,2,3]
python exception
get all keys from redis with python
kishore_kumar | 5 years, 4 months
import redis # pip install redis
r = redis.Redis(host='localhost', port='6379')

python redis
How to load a pickle file in python
harika | 5 years, 7 months
with open('train.pickle', 'rb') as f:
    X_train, y_train = pickle.load(f)
python pickle file
durga
Writing into files in python
durga | 5 years, 9 months
file = open('open.txt','w') 
 
file.write('Hi there!') 
python file handling
Python pickle dump
Reshma | 5 years, 5 months
import pickle

number_of_data = int(input('Enter the number of data : '))
python pickle dump
Remove directory / folder in python
harika | 6 years, 2 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
Ramya
DataFrame with dict of series
Ramya | 5 years, 9 months
import pandas as pd
d = {'One':pd.Series([1,2,3],index=['a','b','c']),'Two':pd.Series([4,5,6],index
python pandas dataframe
how to log full traceback using python logging
kishore_kumar | 5 years, 7 months
import logging
  
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', datefmt=
python logging
Prev Next