Python Code Samples



Filters


Matplotlib create a bar chart in python
kishore_kumar | 6 years, 3 months
import matplotlib.pyplot as plt

categories = ['Student', 'FreeLancer', 'Employee', 'Others']
python matplotlib
Listing contents of a bucket with boto3
Reshma | 5 years, 5 months
import boto3

_BUCKET_NAME = 'Bucket_name'
boto3 files s3 bucket
Threading in python basic example - create a Thread
kishore_kumar | 6 years, 3 months
import threading
import time

python threading
Ramya
DataFrame Row Selection, Addition,Slicing and Deletion
Ramya | 5 years, 6 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 get image width and height using python
kishore_kumar | 5 years, 6 months
from PIL import Image

im = Image.open('my_image.png')
python python-pil
Ramya
PYTHON: Random Password Generator
Ramya | 4 years, 11 months
import random
import string
def randomPassword(stringLength):
random python
Get system hostname using python
kishore_kumar | 3 years, 11 months
import socket
print(socket.gethostname())

python socket
How to check given date comes under given cron schedule in python
kishore_kumar | 5 years, 4 months
# pip install croniter

import datetime
python croniter crontab
Send message to user in slack with python and slack api
kishore_kumar | 6 years, 2 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
Python pandas dataframe select two records for each value of a column using group by
kishore_kumar | 3 years, 8 months
df = pd.DataFrame({'id':[1,1,1,2,2,2,3,3,3,4,4,4], 'value': ['one','two','three','one','two','three'
python dataframe
Prev Next