Python Code Samples



Filters


Ramya
PYTHON: Random Password Generator
Ramya | 6 years, 9 months
import random
import string
def randomPassword(stringLength):
random python
Ramya
DataFrame Row Selection, Addition,Slicing and Deletion
Ramya | 7 years, 4 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
Crating a bucket in S3 using boto3
Reshma | 7 years, 3 months
import boto3
sess = Session(aws_access_key_id='aws_key',
            aws_secret_access_key='aws_se
boto3 s3 create bucket
get time between dates for each day
kishore_kumar | 3 years, 1 month
from datetime import datetime, timedelta


python datetime
Send message to user in slack with python and slack api
kishore_kumar | 7 years, 12 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
POST request in python using requests
kishore_kumar | 8 years
import requests

url = "https://httpbin.org/post"
url can be your API/service URL for your request.
python python-requests
How to check given date comes under given cron schedule in python
kishore_kumar | 7 years, 2 months
# pip install croniter

import datetime
python croniter crontab
durga
Finding Character in a String python
durga | 7 years, 4 months
S1=raw_input("enter String")
S2=raw_input("enter character")
S1=S1.upper() #we are changing into u
We can use lower() also, But both the strings should be changed into the same case(upper/lower).
python string in operator
Draw subplots in matplotlib
harika | 7 years, 9 months
import matplotlib.pyplot as plt
plt.figure(1)
plt.subplot(211)
You can see the output in the attached image. If you want to play with plot then set specific prope
python matplotlib
convert all dataframe column names to lower case
kishore_kumar | 7 years, 3 months
import pandas as pd

data = [['Alex',10],['Bob',12],['Clarke',13]]
python pandas
Prev Next