Python Code Samples



Filters


Ramya
PYTHON: AWS IAM password reset
Ramya | 5 years, 9 months
import boto3
client = boto3.client('iam')
UserName=input("Enter UserName:")
boto3 python
Convert yaml / yml file contents to python dictionary object
kishore_kumar | 6 years, 5 months
import yaml

with open('sample.yaml') as f:
python yaml yml
gaya38
Python program for prime number check
gaya38 | 7 years, 3 months
a=input("Enter a value:")
k=0
b=(a/2)+1
python
gaya38
Python program for even number checking
gaya38 | 7 years, 3 months
a=input("Enter a value:")
if (a%2==0):
    print "The given number is even number"
python
gaya38
generate fibonacci series in python
gaya38 | 7 years, 3 months
n=input("Enter the constraint to print no of fibanocci values:")
m=input("Enter the maximum value t
python
gaya38
Pass command line arguments in python
gaya38 | 7 years, 3 months
import sys
x=len(sys.argv)
a=[]
python
Rename columns in pandas python dataframe
kishore_kumar | 5 years, 2 months
import pandas as pd

data = [['Alex',10],['Bob',12],['Clarke',13]]
python pandas
get all meta tags content from a url using python
kishore_kumar | 6 years, 9 months
#This can be done using BeautifulSoup package
import requests
from bs4 import BeautifulSoup
python bs4 beautifulsoup
Get system hostname using python
kishore_kumar | 4 years, 9 months
import socket
print(socket.gethostname())

python socket
Python pandas dataframe select two records for each value of a column using group by
kishore_kumar | 4 years, 5 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