Skip to content

Instantly share code, notes, and snippets.

View amitabhadey's full-sized avatar
🥷
At work

amitabhadey amitabhadey

🥷
At work
View GitHub Profile
@amitabhadey
amitabhadey / Sentiment via TextBlob
Created February 27, 2018 21:56
Sentiment via TextBlob
from textblob import TextBlob
wiki = TextBlob("I am very happy but also a little sad.")
print(wiki.sentiment.polarity)
@amitabhadey
amitabhadey / data_preprocessing_template.py
Created July 22, 2018 19:47
Steps followed for preprocessing the data for ML
# Data Preprocessing Template
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
@amitabhadey
amitabhadey / Email Personal Assistant
Created August 26, 2018 14:50
A personal assistant to send mails
import os
import webbrowser
import time
from gtts import gTTS
import speech_recognition as sr
import smtplib
content = None
receiver = None
@amitabhadey
amitabhadey / dijkstraalgorithm.py
Created April 26, 2019 19:57
Dijkstra's Algorithm in Python
# =============================================================================
# We will create a dictionary to represent the graph
# =============================================================================
graph = {
'a':{'b':3,'c':4, 'd':7},
'b':{'c':1,'f':5},
'c':{'f':6,'d':2},
'd':{'e':3, 'g':6},
'e':{'g':3, 'h':4},