Python Code Samples



Filters


Remove directory / folder in python
harika | 6 years, 7 months
'''
You can remove empty directory by rmdir function.
But to remove non empty directory we have to
Shuttle : A module that offers a number of high-level operations on files and collections of files.
shutil python os
Ramya
DataFrame with dict of series
Ramya | 6 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
how to extract text content from pdf file using python
kishore_kumar | 6 years, 7 months
from tika import parser # pip install tika

process = parser.from_file('/path/to/my.pdf')
python tika
send mail using sendgrid python
kishore_kumar | 6 years, 1 month
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
python sendgrid
Image labels detection using google Vision API in python
kishore_kumar | 6 years, 6 months
from google.cloud import vision
from google.cloud.vision import types

If you setup env variable with export GOOGLE_APPLICATION_CREDENTIALS="/file/creds.json" then you ca
python google vision
How to dump data to a pickle file in python
harika | 5 years, 11 months
X_train = []
y_train = []
with open('train.pickle', 'wb') as f:
python pickle file
Ramya
While loop example in python
Ramya | 6 years, 2 months
i = 0
while (i < 3):     
    i = i+1
python
Ramya
Infinite While loop example in python
Ramya | 6 years, 2 months
i = 0
while (i < 3):     
    if(i==2):
python
get binary code for an integer in python
kishore_kumar | 6 years, 1 month
n = 115

b_n = bin(n)
python binary
get time between dates for each day
kishore_kumar | 1 year, 10 months
from datetime import datetime, timedelta


python datetime
Prev Next