Python Code Samples



Filters


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

categories = ['Student', 'FreeLancer', 'Employee', 'Others']
python matplotlib
Python pandas dataframe select two records for each value of a column using group by
kishore_kumar | 4 years, 3 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
Threading in python basic example - create a Thread
kishore_kumar | 6 years, 11 months
import threading
import time

python threading
How to get image width and height using python
kishore_kumar | 6 years, 2 months
from PIL import Image

im = Image.open('my_image.png')
python python-pil
Ramya
PYTHON: Random Password Generator
Ramya | 5 years, 7 months
import random
import string
def randomPassword(stringLength):
random python
Send message to user in slack with python and slack api
kishore_kumar | 6 years, 10 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
How to check given date comes under given cron schedule in python
kishore_kumar | 6 years
# pip install croniter

import datetime
python croniter crontab
Python get last working day of the month
kishore_kumar | 3 years, 11 months
from datetime import datetime
import calendar

python datetime
How to get full path of python module file and directory
kishore_kumar | 6 years, 2 months
import os

if __name__ == '__main__':
python python-os
How to get first day of the month in python
kishore_kumar | 3 years, 9 months
from datetime import datetime

first_day = datetime.today().date().replace(day=1)
python datetime
Prev Next