Python Code Samples



Filters


Ramya
PYTHON: Random Password Generator
Ramya | 6 years, 6 months
import random
import string
def randomPassword(stringLength):
random python
Ramya
DataFrame Row Selection, Addition,Slicing and Deletion
Ramya | 7 years, 1 month
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
Send message to user in slack with python and slack api
kishore_kumar | 7 years, 9 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
Crating a bucket in S3 using boto3
Reshma | 7 years
import boto3
sess = Session(aws_access_key_id='aws_key',
            aws_secret_access_key='aws_se
boto3 s3 create bucket
POST request in python using requests
kishore_kumar | 7 years, 10 months
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 | 6 years, 11 months
# pip install croniter

import datetime
python croniter crontab
durga
Finding Character in a String python
durga | 7 years, 2 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
get time between dates for each day
kishore_kumar | 2 years, 10 months
from datetime import datetime, timedelta


python datetime
yogeswaran60
Basic Matrix Manipulations in Python Without Using Any Packages
yogeswaran60 | 7 years, 9 months
#Matrix Manipulations Without using any packages
#Define Matrix A,B,C 
A=[[1,2,3],
Change the result matrix dimension according to Matrix Dimensions properties Product of (M*N) and (
python matrix
convert all dataframe column names to lower case
kishore_kumar | 7 years
import pandas as pd

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