Python Code Samples



Filters


how to extract text content from pdf file using python
kishore_kumar | 5 years, 8 months
from tika import parser # pip install tika

process = parser.from_file('/path/to/my.pdf')
python tika
Ramya
DataFrame with dict of series
Ramya | 5 years, 3 months
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 access django models in stand alone python script without manage.py
kishore_kumar | 5 years, 1 month
import os
import django

python django
Image labels detection using google Vision API in python
kishore_kumar | 5 years, 8 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 log full traceback using python logging
kishore_kumar | 5 years, 1 month
import logging
  
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', datefmt=
python logging
How to dump data to a pickle file in python
harika | 5 years, 1 month
X_train = []
y_train = []
with open('train.pickle', 'wb') as f:
python pickle file
Ramya
While loop example in python
Ramya | 5 years, 3 months
i = 0
while (i < 3):     
    i = i+1
python
Ramya
Infinite While loop example in python
Ramya | 5 years, 3 months
i = 0
while (i < 3):     
    if(i==2):
python
How to do web scrapping from a website for getting keywords
sonia shaik | 5 years, 3 months
from bs4 import BeautifulSoup
from bs4.element import Comment
from urllib.request import Request, 
python web scrapping nltk
Python pickle load
Reshma | 4 years, 10 months
import pickle

# open a file,where we stored the pickle data
python load pickle
Prev Next