Python Code Samples



Filters


Django filter and sum query
kishore_kumar | 2 years, 10 months
from django.db.models import Sum

# Model -> Marks
python django django-orm
Ramya
Removing IAM Users from IAM group
Ramya | 5 years, 6 months
def remove_user():
    import boto3
    client = boto3.client('iam')
boto3 aws python
gaya38
Pass command line arguments in python
gaya38 | 6 years, 1 month
import sys
x=len(sys.argv)
a=[]
python
gaya38
Python program for even number checking
gaya38 | 6 years, 1 month
a=input("Enter a value:")
if (a%2==0):
    print "The given number is even number"
python
Get records from azure sql table as python dictionary
kishore_kumar | 5 years, 3 months
from contextlib import contextmanager
import datetime

python azure
Find min , max and mean for numpy arrays
kishore_kumar | 6 years, 1 month
import numpy as np

random_arr = np.random.randint(1,50,9)
python numpy
get all meta tags content from a url using python
kishore_kumar | 5 years, 8 months
#This can be done using BeautifulSoup package
import requests
from bs4 import BeautifulSoup
python bs4 beautifulsoup
Ramya
Finding usage of the file system in linux using python
Ramya | 4 years, 10 months
import subprocess
threshold = input("Enter the threshold value:")
child = subprocess.Popen(['df','
python linux subprocess
gaya38
print list of even numbers within a range
gaya38 | 6 years, 1 month
n=100
a=[10,20,30,40,50]
b=[60,70,80,90]
python
Rename columns in pandas python dataframe
kishore_kumar | 4 years
import pandas as pd

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