Python Code Samples



Filters


Create a line chart using python matplotlib
kishore_kumar | 7 years, 6 months
import matplotlib.pyplot as plt

t = ['12-03-18','12-04-18' , '12-05-18', '12-06-18', '12-07-18']
python matplotlib
Using python generator for finding factors
kishore_kumar | 6 years, 10 months
def get_factors(num):
    i = 1
    while i * i < num:
python generator factors
how to log full traceback using python logging
kishore_kumar | 6 years, 9 months
import logging
  
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', datefmt=
python logging
Ramya
Indexed DataFrame using list of dictionaries
Ramya | 6 years, 11 months
import pandas as pd
data = [{'Python': 90, 'C': 84,'java':65},{'Python': 78, 'C': 90, 'java': 65}]
python pandas dataframe
round a floating point number in python
kishore_kumar | 7 years, 6 months
my_number = 123.83725

print round(my_number, 2) # 123.84
python
unzip file from gz files using python
kishore_kumar | 6 years, 8 months
import gzip
import shutil
with gzip.open('my_file.gz', 'rb') as f_in:
python gzip
Text identification in the image using google vision API with python
kishore_kumar | 7 years, 2 months
from google.cloud import vision
from google.cloud.vision import types

python google vision
How to access django models in stand alone python script without manage.py
kishore_kumar | 6 years, 9 months
import os
import django

python django
convert python date time object to specific format using strftime
kishore_kumar | 6 years, 10 months
import datetime

st = "2019-08-19 05:40"
python datetime
durga
Writing into files in python
durga | 6 years, 10 months
file = open('open.txt','w') 
 
file.write('Hi there!') 
python file handling
Prev Next