Skip to content

Instantly share code, notes, and snippets.

@getgimphed
getgimphed / List.md
Created October 3, 2015 20:36 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@getgimphed
getgimphed / KMeans_ImageCompression.py
Last active April 28, 2020 17:32
Using KMeans Clustering for Image Compression
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
# Loading the image
org_image = Image.open('Kheerganga.jpeg','r')
pixels = list(org_image.getdata())
final_pixels = []
for i in range(0,len(pixels)):
final_pixels.append( np.array(pixels[i]) )
# Importing the libraries
import docx2txt
import pickle
import re
# TH : The Hindu, TOI : Times of India, IE : Indian Express, HT : Hindustan Times
# Loading newspaper text using docx2txt python library.
THtext = docx2txt.process("TH.docx")
TOItext = docx2txt.process("TOI.docx")
IEtext = docx2txt.process("IE.docx")
# Evaluating 4 Indian English NewsPapers for 10th May 2020 for their
## Vocabulary or No of Unique words per Paragraphs
## Factual Presentation
## Sentimental Analysis
## Graphic content/ images : Needs preprocessing
## Visualising
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd