About this Map
47 |48 | This is a cool map from 49 | www.pythonlearn.com. 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/gbasic.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import urllib 4 | import zlib 5 | 6 | howmany = int(raw_input("How many to dump? ")) 7 | 8 | conn = sqlite3.connect('index.sqlite') 9 | conn.text_factory = str 10 | cur = conn.cursor() 11 | 12 | cur.execute('''SELECT Messages.id, sender FROM Messages 13 | JOIN Senders ON Messages.sender_id = Senders.id''') 14 | 15 | sendcounts = dict() 16 | sendorgs = dict() 17 | for message in cur : 18 | sender = message[1] 19 | sendcounts[sender] = sendcounts.get(sender,0) + 1 20 | pieces = sender.split("@") 21 | if len(pieces) != 2 : continue 22 | dns = pieces[1] 23 | sendorgs[dns] = sendorgs.get(dns,0) + 1 24 | 25 | print '' 26 | print 'Top',howmany,'Email list participants' 27 | 28 | x = sorted(sendcounts, key=sendcounts.get, reverse=True) 29 | for k in x[:howmany]: 30 | print k, sendcounts[k] 31 | if sendcounts[k] < 10 : break 32 | 33 | print '' 34 | print 'Top',howmany,'Email list organizations' 35 | 36 | x = sorted(sendorgs, key=sendorgs.get, reverse=True) 37 | for k in x[:howmany]: 38 | print k, sendorgs[k] 39 | if sendorgs[k] < 10 : break 40 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/gline.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/gline.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import urllib 4 | import zlib 5 | 6 | conn = sqlite3.connect('index.sqlite') 7 | conn.text_factory = str 8 | cur = conn.cursor() 9 | 10 | # Determine the top ten organizations 11 | cur.execute('''SELECT Messages.id, sender FROM Messages 12 | JOIN Senders ON Messages.sender_id = Senders.id''') 13 | 14 | sendorgs = dict() 15 | for message_row in cur : 16 | sender = message_row[1] 17 | pieces = sender.split("@") 18 | if len(pieces) != 2 : continue 19 | dns = pieces[1] 20 | sendorgs[dns] = sendorgs.get(dns,0) + 1 21 | 22 | # pick the top schools 23 | orgs = sorted(sendorgs, key=sendorgs.get, reverse=True) 24 | orgs = orgs[:10] 25 | print "Top 10 Organizations" 26 | print orgs 27 | # orgs = ['total'] + orgs 28 | 29 | # Read through the messages 30 | counts = dict() 31 | months = list() 32 | 33 | cur.execute('''SELECT Messages.id, sender, sent_at FROM Messages 34 | JOIN Senders ON Messages.sender_id = Senders.id''') 35 | 36 | for message_row in cur : 37 | sender = message_row[1] 38 | pieces = sender.split("@") 39 | if len(pieces) != 2 : continue 40 | dns = pieces[1] 41 | if dns not in orgs : continue 42 | month = message_row[2][:7] 43 | if month not in months : months.append(month) 44 | key = (month, dns) 45 | counts[key] = counts.get(key,0) + 1 46 | tkey = (month, 'total') 47 | counts[tkey] = counts.get(tkey,0) + 1 48 | 49 | months.sort() 50 | print counts 51 | print months 52 | 53 | fhand = open('gline.js','w') 54 | fhand.write("gline = [ ['Month'") 55 | for org in orgs: 56 | fhand.write(",'"+org+"'") 57 | fhand.write("]") 58 | 59 | # for month in months[1:-1]: 60 | for month in months: 61 | fhand.write(",\n['"+month+"'") 62 | for org in orgs: 63 | key = (month, org) 64 | val = counts.get(key,0) 65 | fhand.write(","+str(val)) 66 | fhand.write("]"); 67 | 68 | fhand.write("\n];\n") 69 | 70 | print "Data written to gline.js" 71 | print "Open gline.htm in a browser to view" 72 | 73 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/gline2.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/gword.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 37 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/gword.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import urllib 4 | import zlib 5 | import string 6 | 7 | conn = sqlite3.connect('index.sqlite') 8 | conn.text_factory = str 9 | cur = conn.cursor() 10 | 11 | cur.execute('''SELECT subject_id,subject FROM Messages 12 | JOIN Subjects ON Messages.subject_id = Subjects.id''') 13 | 14 | counts = dict() 15 | for message_row in cur : 16 | text = message_row[1] 17 | text = text.translate(None, string.punctuation) 18 | text = text.translate(None, '1234567890') 19 | text = text.strip() 20 | text = text.lower() 21 | words = text.split() 22 | for word in words: 23 | if len(word) < 4 : continue 24 | counts[word] = counts.get(word,0) + 1 25 | 26 | # Find the top 100 words 27 | words = sorted(counts, key=counts.get, reverse=True) 28 | highest = None 29 | lowest = None 30 | for w in words[:100]: 31 | if highest is None or highest < counts[w] : 32 | highest = counts[w] 33 | if lowest is None or lowest > counts[w] : 34 | lowest = counts[w] 35 | print 'Range of counts:',highest,lowest 36 | 37 | # Spread the font sizes across 20-100 based on the count 38 | bigsize = 80 39 | smallsize = 20 40 | 41 | fhand = open('gword.js','w') 42 | fhand.write("gword = [") 43 | first = True 44 | for k in words[:100]: 45 | if not first : fhand.write( ",\n") 46 | first = False 47 | size = counts[k] 48 | size = (size - lowest) / float(highest - lowest) 49 | size = int((size * bigsize) + smallsize) 50 | fhand.write("{text: '"+k+"', size: "+str(size)+"}") 51 | fhand.write( "\n];\n") 52 | 53 | print "Output written to gword.js" 54 | print "Open gword.htm in a browser to view" 55 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/gyear.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import urllib 4 | import zlib 5 | 6 | conn = sqlite3.connect('index.sqlite') 7 | conn.text_factory = str 8 | cur = conn.cursor() 9 | 10 | # Determine the top ten organizations 11 | cur.execute('''SELECT Messages.id, sender FROM Messages 12 | JOIN Senders ON Messages.sender_id = Senders.id''') 13 | 14 | sendorgs = dict() 15 | for message_row in cur : 16 | sender = message_row[1] 17 | pieces = sender.split("@") 18 | if len(pieces) != 2 : continue 19 | dns = pieces[1] 20 | sendorgs[dns] = sendorgs.get(dns,0) + 1 21 | 22 | # pick the top schools 23 | orgs = sorted(sendorgs, key=sendorgs.get, reverse=True) 24 | orgs = orgs[:10] 25 | print "Top 10 Organizations" 26 | print orgs 27 | # orgs = ['total'] + orgs 28 | 29 | # Read through the messages 30 | counts = dict() 31 | years = list() 32 | 33 | cur.execute('''SELECT Messages.id, sender, sent_at FROM Messages 34 | JOIN Senders ON Messages.sender_id = Senders.id''') 35 | 36 | for message_row in cur : 37 | sender = message_row[1] 38 | pieces = sender.split("@") 39 | if len(pieces) != 2 : continue 40 | dns = pieces[1] 41 | if dns not in orgs : continue 42 | year = message_row[2][:4] 43 | if year not in years : years.append(year) 44 | key = (year, dns) 45 | counts[key] = counts.get(key,0) + 1 46 | tkey = (year, 'total') 47 | counts[tkey] = counts.get(tkey,0) + 1 48 | 49 | years.sort() 50 | print counts 51 | print years 52 | 53 | fhand = open('gline.js','w') 54 | fhand.write("gline = [ ['Year'") 55 | for org in orgs: 56 | fhand.write(",'"+org+"'") 57 | fhand.write("]") 58 | 59 | # for year in years[1:-1]: 60 | for year in years: 61 | fhand.write(",\n['"+year+"'") 62 | for org in orgs: 63 | key = (year, org) 64 | val = counts.get(key,0) 65 | fhand.write(","+str(val)) 66 | fhand.write("]"); 67 | 68 | fhand.write("\n];\n") 69 | 70 | print "Data written to gline.js" 71 | print "Open gline.htm in a browser to view" 72 | 73 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/gmane/mapping.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-4-python_databases/w5_dbvisualisation/gmane/mapping.sqlite -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/mailing_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-4-python_databases/w5_dbvisualisation/mailing_list.png -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/mailing_lists.txt: -------------------------------------------------------------------------------- 1 | Mailing Lists 2 | 1. Crawl archive of mailing list 3 | 2. Analyse and clean-up 4 | 3. Visualise data 5 | 6 | 7 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/multistep_data_analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-4-python_databases/w5_dbvisualisation/multistep_data_analysis.png -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/new-geodumpy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-4-python_databases/w5_dbvisualisation/new-geodumpy.png -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-4-python_databases/w5_dbvisualisation/output.png -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/page_rank_web_search.txt: -------------------------------------------------------------------------------- 1 | Page Rank 2 | 1. Write a simple web page crawler 3 | 2. Compute simple version of Google's Page Rank algorithm 4 | 3. Visualize resulting network 5 | 6 | Search Engine Architecture 7 | 1. Web Crawling 8 | - Browses the WWW in a methodical and automated manner 9 | - Create copy of pages to be indexed for fast searching 10 | a. Create list of websites to crawl 11 | b. Retrieve page 12 | c. Look through for links 13 | d. Add links to list 14 | e. Repeat 15 | 2. Index Building 16 | - Collects, parses and stores data 17 | - Facilitate fast & accurate data retrieval 18 | 19 | 3. Searching 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/pagerank/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Michael Bostock 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * The name Michael Bostock may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/pagerank/force.css: -------------------------------------------------------------------------------- 1 | circle.node { 2 | stroke: #fff; 3 | stroke-width: 1.5px; 4 | } 5 | 6 | line.link { 7 | stroke: #999; 8 | stroke-opacity: .6; 9 | } 10 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/pagerank/force.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |If you don't see a chart above, check the JavaScript console. You may 16 | need to use a different browser.
17 | 18 | 19 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/pagerank/force.js: -------------------------------------------------------------------------------- 1 | var width = 600, 2 | height = 600; 3 | 4 | var color = d3.scale.category20(); 5 | 6 | var dist = (width + height) / 4; 7 | 8 | var force = d3.layout.force() 9 | .charge(-120) 10 | .linkDistance(dist) 11 | .size([width, height]); 12 | 13 | function getrank(rval) { 14 | return (rval/2.0) + 3; 15 | } 16 | 17 | function getcolor(rval) { 18 | return color(rval); 19 | } 20 | 21 | var svg = d3.select("#chart").append("svg") 22 | .attr("width", width) 23 | .attr("height", height); 24 | 25 | function loadData(json) { 26 | force 27 | .nodes(json.nodes) 28 | .links(json.links); 29 | 30 | var k = Math.sqrt(json.nodes.length / (width * height)); 31 | 32 | force 33 | .charge(-10 / k) 34 | .gravity(100 * k) 35 | .start(); 36 | 37 | var link = svg.selectAll("line.link") 38 | .data(json.links) 39 | .enter().append("line") 40 | .attr("class", "link") 41 | .style("stroke-width", function(d) { return Math.sqrt(d.value); }); 42 | 43 | var node = svg.selectAll("circle.node") 44 | .data(json.nodes) 45 | .enter().append("circle") 46 | .attr("class", "node") 47 | .attr("r", function(d) { return getrank(d.rank); } ) 48 | .style("fill", function(d) { return getcolor(d.rank); }) 49 | .on("dblclick",function(d) { 50 | if ( confirm('Do you want to open '+d.url) ) 51 | window.open(d.url,'_new',''); 52 | d3.event.stopPropagation(); 53 | }) 54 | .call(force.drag); 55 | 56 | node.append("title") 57 | .text(function(d) { return d.url; }); 58 | 59 | force.on("tick", function() { 60 | link.attr("x1", function(d) { return d.source.x; }) 61 | .attr("y1", function(d) { return d.source.y; }) 62 | .attr("x2", function(d) { return d.target.x; }) 63 | .attr("y2", function(d) { return d.target.y; }); 64 | 65 | node.attr("cx", function(d) { return d.x; }) 66 | .attr("cy", function(d) { return d.y; }); 67 | }); 68 | 69 | } 70 | loadData(spiderJson); 71 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/pagerank/spdump.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | conn = sqlite3.connect('spider.sqlite') 4 | cur = conn.cursor() 5 | 6 | cur.execute('''SELECT COUNT(from_id) AS inbound, old_rank, new_rank, id, url 7 | FROM Pages JOIN Links ON Pages.id = Links.to_id 8 | WHERE html IS NOT NULL 9 | GROUP BY id ORDER BY inbound DESC''') 10 | 11 | count = 0 12 | for row in cur : 13 | if count < 50 : print row 14 | count = count + 1 15 | print count, 'rows.' 16 | cur.close() 17 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/pagerank/spjson.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | conn = sqlite3.connect('spider.sqlite') 4 | cur = conn.cursor() 5 | 6 | print "Creating JSON output on spider.js..." 7 | howmany = int(raw_input("How many nodes? ")) 8 | 9 | cur.execute('''SELECT COUNT(from_id) AS inbound, old_rank, new_rank, id, url 10 | FROM Pages JOIN Links ON Pages.id = Links.to_id 11 | WHERE html IS NOT NULL AND ERROR IS NULL 12 | GROUP BY id ORDER BY id,inbound''') 13 | 14 | fhand = open('spider.js','w') 15 | nodes = list() 16 | maxrank = None 17 | minrank = None 18 | for row in cur : 19 | nodes.append(row) 20 | rank = row[2] 21 | if maxrank < rank or maxrank is None : maxrank = rank 22 | if minrank > rank or minrank is None : minrank = rank 23 | if len(nodes) > howmany : break 24 | 25 | if maxrank == minrank or maxrank is None or minrank is None: 26 | print "Error - please run sprank.py to compute page rank" 27 | quit() 28 | 29 | fhand.write('spiderJson = {"nodes":[\n') 30 | count = 0 31 | map = dict() 32 | ranks = dict() 33 | for row in nodes : 34 | if count > 0 : fhand.write(',\n') 35 | # print row 36 | rank = row[2] 37 | rank = 19 * ( (rank - minrank) / (maxrank - minrank) ) 38 | fhand.write('{'+'"weight":'+str(row[0])+',"rank":'+str(rank)+',') 39 | fhand.write(' "id":'+str(row[3])+', "url":"'+row[4]+'"}') 40 | map[row[3]] = count 41 | ranks[row[3]] = rank 42 | count = count + 1 43 | fhand.write('],\n') 44 | 45 | cur.execute('''SELECT DISTINCT from_id, to_id FROM Links''') 46 | fhand.write('"links":[\n') 47 | 48 | count = 0 49 | for row in cur : 50 | # print row 51 | if row[0] not in map or row[1] not in map : continue 52 | if count > 0 : fhand.write(',\n') 53 | rank = ranks[row[0]] 54 | srank = 19 * ( (rank - minrank) / (maxrank - minrank) ) 55 | fhand.write('{"source":'+str(map[row[0]])+',"target":'+str(map[row[1]])+',"value":3}') 56 | count = count + 1 57 | fhand.write(']};') 58 | fhand.close() 59 | cur.close() 60 | 61 | print "Open force.html in a browser to view the visualization" 62 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/pagerank/spreset.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | conn = sqlite3.connect('spider.sqlite') 4 | cur = conn.cursor() 5 | 6 | cur.execute('''UPDATE Pages SET new_rank=1.0, old_rank=0.0''') 7 | conn.commit() 8 | 9 | cur.close() 10 | 11 | print "All pages set to a rank of 1.0" 12 | -------------------------------------------------------------------------------- /Course-4-python_databases/w5_dbvisualisation/web_crawling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-4-python_databases/w5_dbvisualisation/web_crawling.png -------------------------------------------------------------------------------- /Course-5 Capstone Retriveing Processing and Visulaisation data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5 Capstone Retriveing Processing and Visulaisation data.pdf -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/certificate.pdf -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/certificate_Python for Everybody.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/certificate_Python for Everybody.pdf -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/GLineYearVisualization.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/GLineYearVisualization.jpg -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/GWordVisualization.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/GWordVisualization.jpg -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/Gbasic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/Gbasic.jpg -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/IndexSQLite.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/IndexSQLite.jpg -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/TimeLineVisualization.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/TimeLineVisualization.jpg -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/index-sqlite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/index-sqlite.png -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/spliteBrowser-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/spliteBrowser-1.png -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/week-6-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane output/week-6-1.jpg -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/.gitignore: -------------------------------------------------------------------------------- 1 | content.sqlite 2 | index.sqlite -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/gbasic.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import zlib 4 | 5 | howmany = int(input("How many to dump? ")) 6 | 7 | conn = sqlite3.connect('index.sqlite') 8 | cur = conn.cursor() 9 | 10 | cur.execute('SELECT id, sender FROM Senders') 11 | senders = dict() 12 | for message_row in cur : 13 | senders[message_row[0]] = message_row[1] 14 | 15 | cur.execute('SELECT id, subject FROM Subjects') 16 | subjects = dict() 17 | for message_row in cur : 18 | subjects[message_row[0]] = message_row[1] 19 | 20 | # cur.execute('SELECT id, guid,sender_id,subject_id,headers,body FROM Messages') 21 | cur.execute('SELECT id, guid,sender_id,subject_id,sent_at FROM Messages') 22 | messages = dict() 23 | for message_row in cur : 24 | messages[message_row[0]] = (message_row[1],message_row[2],message_row[3],message_row[4]) 25 | 26 | print("Loaded messages=",len(messages),"subjects=",len(subjects),"senders=",len(senders)) 27 | 28 | sendcounts = dict() 29 | sendorgs = dict() 30 | for (message_id, message) in list(messages.items()): 31 | sender = message[1] 32 | sendcounts[sender] = sendcounts.get(sender,0) + 1 33 | pieces = senders[sender].split("@") 34 | if len(pieces) != 2 : continue 35 | dns = pieces[1] 36 | sendorgs[dns] = sendorgs.get(dns,0) + 1 37 | 38 | print('') 39 | print('Top',howmany,'Email list participants') 40 | 41 | x = sorted(sendcounts, key=sendcounts.get, reverse=True) 42 | for k in x[:howmany]: 43 | print(senders[k], sendcounts[k]) 44 | if sendcounts[k] < 10 : break 45 | 46 | print('') 47 | print('Top',howmany,'Email list organizations') 48 | 49 | x = sorted(sendorgs, key=sendorgs.get, reverse=True) 50 | for k in x[:howmany]: 51 | print(k, sendorgs[k]) 52 | if sendorgs[k] < 10 : break 53 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/gline.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/gline.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import zlib 4 | 5 | conn = sqlite3.connect('index.sqlite') 6 | cur = conn.cursor() 7 | 8 | cur.execute('SELECT id, sender FROM Senders') 9 | senders = dict() 10 | for message_row in cur : 11 | senders[message_row[0]] = message_row[1] 12 | 13 | cur.execute('SELECT id, guid,sender_id,subject_id,sent_at FROM Messages') 14 | messages = dict() 15 | for message_row in cur : 16 | messages[message_row[0]] = (message_row[1],message_row[2],message_row[3],message_row[4]) 17 | 18 | print("Loaded messages=",len(messages),"senders=",len(senders)) 19 | 20 | sendorgs = dict() 21 | for (message_id, message) in list(messages.items()): 22 | sender = message[1] 23 | pieces = senders[sender].split("@") 24 | if len(pieces) != 2 : continue 25 | dns = pieces[1] 26 | sendorgs[dns] = sendorgs.get(dns,0) + 1 27 | 28 | # pick the top schools 29 | orgs = sorted(sendorgs, key=sendorgs.get, reverse=True) 30 | orgs = orgs[:10] 31 | print("Top 10 Organizations") 32 | print(orgs) 33 | 34 | counts = dict() 35 | months = list() 36 | # cur.execute('SELECT id, guid,sender_id,subject_id,sent_at FROM Messages') 37 | for (message_id, message) in list(messages.items()): 38 | sender = message[1] 39 | pieces = senders[sender].split("@") 40 | if len(pieces) != 2 : continue 41 | dns = pieces[1] 42 | if dns not in orgs : continue 43 | month = message[3][:7] 44 | if month not in months : months.append(month) 45 | key = (month, dns) 46 | counts[key] = counts.get(key,0) + 1 47 | 48 | months.sort() 49 | # print counts 50 | # print months 51 | 52 | fhand = open('gline.js','w') 53 | fhand.write("gline = [ ['Month'") 54 | for org in orgs: 55 | fhand.write(",'"+org+"'") 56 | fhand.write("]") 57 | 58 | for month in months: 59 | fhand.write(",\n['"+month+"'") 60 | for org in orgs: 61 | key = (month, org) 62 | val = counts.get(key,0) 63 | fhand.write(","+str(val)) 64 | fhand.write("]"); 65 | 66 | fhand.write("\n];\n") 67 | fhand.close() 68 | 69 | print("Output written to gline.js") 70 | print("Open gline.htm to visualize the data") 71 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/gword.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 37 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/gword.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import zlib 4 | import string 5 | 6 | conn = sqlite3.connect('index.sqlite') 7 | cur = conn.cursor() 8 | 9 | cur.execute('SELECT id, subject FROM Subjects') 10 | subjects = dict() 11 | for message_row in cur : 12 | subjects[message_row[0]] = message_row[1] 13 | 14 | # cur.execute('SELECT id, guid,sender_id,subject_id,headers,body FROM Messages') 15 | cur.execute('SELECT subject_id FROM Messages') 16 | counts = dict() 17 | for message_row in cur : 18 | text = subjects[message_row[0]] 19 | text = text.translate(str.maketrans('','',string.punctuation)) 20 | text = text.translate(str.maketrans('','','1234567890')) 21 | text = text.strip() 22 | text = text.lower() 23 | words = text.split() 24 | for word in words: 25 | if len(word) < 4 : continue 26 | counts[word] = counts.get(word,0) + 1 27 | 28 | x = sorted(counts, key=counts.get, reverse=True) 29 | highest = None 30 | lowest = None 31 | for k in x[:100]: 32 | if highest is None or highest < counts[k] : 33 | highest = counts[k] 34 | if lowest is None or lowest > counts[k] : 35 | lowest = counts[k] 36 | print('Range of counts:',highest,lowest) 37 | 38 | # Spread the font sizes across 20-100 based on the count 39 | bigsize = 80 40 | smallsize = 20 41 | 42 | fhand = open('gword.js','w') 43 | fhand.write("gword = [") 44 | first = True 45 | for k in x[:100]: 46 | if not first : fhand.write( ",\n") 47 | first = False 48 | size = counts[k] 49 | size = (size - lowest) / float(highest - lowest) 50 | size = int((size * bigsize) + smallsize) 51 | fhand.write("{text: '"+k+"', size: "+str(size)+"}") 52 | fhand.write( "\n];\n") 53 | fhand.close() 54 | 55 | print("Output written to gword.js") 56 | print("Open gword.htm in a browser to see the vizualization") 57 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/gyear.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import time 3 | import urllib.request, urllib.parse, urllib.error 4 | import zlib 5 | 6 | conn = sqlite3.connect('index.sqlite') 7 | cur = conn.cursor() 8 | 9 | cur.execute('SELECT id, sender FROM Senders') 10 | senders = dict() 11 | for message_row in cur : 12 | senders[message_row[0]] = message_row[1] 13 | 14 | cur.execute('SELECT id, guid,sender_id,subject_id,sent_at FROM Messages') 15 | messages = dict() 16 | for message_row in cur : 17 | messages[message_row[0]] = (message_row[1],message_row[2],message_row[3],message_row[4]) 18 | 19 | print("Loaded messages=",len(messages),"senders=",len(senders)) 20 | 21 | sendorgs = dict() 22 | for (message_id, message) in list(messages.items()): 23 | sender = message[1] 24 | pieces = senders[sender].split("@") 25 | if len(pieces) != 2 : continue 26 | dns = pieces[1] 27 | sendorgs[dns] = sendorgs.get(dns,0) + 1 28 | 29 | # pick the top schools 30 | orgs = sorted(sendorgs, key=sendorgs.get, reverse=True) 31 | orgs = orgs[:10] 32 | print("Top 10 Organizations") 33 | print(orgs) 34 | # orgs = ['total'] + orgs 35 | 36 | counts = dict() 37 | months = list() 38 | # cur.execute('SELECT id, guid,sender_id,subject_id,sent_at FROM Messages') 39 | for (message_id, message) in list(messages.items()): 40 | sender = message[1] 41 | pieces = senders[sender].split("@") 42 | if len(pieces) != 2 : continue 43 | dns = pieces[1] 44 | if dns not in orgs : continue 45 | month = message[3][:4] 46 | if month not in months : months.append(month) 47 | key = (month, dns) 48 | counts[key] = counts.get(key,0) + 1 49 | tkey = (month, 'total') 50 | counts[tkey] = counts.get(tkey,0) + 1 51 | 52 | months.sort() 53 | # print counts 54 | # print months 55 | 56 | fhand = open('gline.js','w') 57 | fhand.write("gline = [ ['Year'") 58 | for org in orgs: 59 | fhand.write(",'"+org+"'") 60 | fhand.write("]") 61 | 62 | for month in months[1:-1]: 63 | fhand.write(",\n['"+month+"'") 64 | for org in orgs: 65 | key = (month, org) 66 | val = counts.get(key,0) 67 | fhand.write(","+str(val)) 68 | fhand.write("]"); 69 | 70 | fhand.write("\n];\n") 71 | fhand.close() 72 | 73 | print("Output written to gline.js") 74 | print("Open gline.htm to visualize the data") 75 | 76 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/mapping.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/gmane/mapping.sqlite -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/force-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/force-2.png -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/froce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/froce.png -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/spdump-2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/spdump-2.JPG -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/spdump-py.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/spdump-py.JPG -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/spider_py.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pageRank Output/spider_py.JPG -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/.gitignore: -------------------------------------------------------------------------------- 1 | content.sqlite 2 | index.sqlite 3 | spider.sqlite -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/BeautifulSoup.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/BeautifulSoup.pyc -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Michael Bostock 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * The name Michael Bostock may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/force.css: -------------------------------------------------------------------------------- 1 | circle.node { 2 | stroke: #fff; 3 | stroke-width: 1.5px; 4 | } 5 | 6 | line.link { 7 | stroke: #999; 8 | stroke-opacity: .6; 9 | } 10 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/force.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |If you don't see a chart above, check the JavaScript console. You may 16 | need to use a different browser.
17 | 18 | 19 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/force.js: -------------------------------------------------------------------------------- 1 | var width = 600, 2 | height = 600; 3 | 4 | var color = d3.scale.category20(); 5 | 6 | var dist = (width + height) / 4; 7 | 8 | var force = d3.layout.force() 9 | .charge(-120) 10 | .linkDistance(dist) 11 | .size([width, height]); 12 | 13 | function getrank(rval) { 14 | return (rval/2.0) + 3; 15 | } 16 | 17 | function getcolor(rval) { 18 | return color(rval); 19 | } 20 | 21 | var svg = d3.select("#chart").append("svg") 22 | .attr("width", width) 23 | .attr("height", height); 24 | 25 | function loadData(json) { 26 | force 27 | .nodes(json.nodes) 28 | .links(json.links); 29 | 30 | var k = Math.sqrt(json.nodes.length / (width * height)); 31 | 32 | force 33 | .charge(-10 / k) 34 | .gravity(100 * k) 35 | .start(); 36 | 37 | var link = svg.selectAll("line.link") 38 | .data(json.links) 39 | .enter().append("line") 40 | .attr("class", "link") 41 | .style("stroke-width", function(d) { return Math.sqrt(d.value); }); 42 | 43 | var node = svg.selectAll("circle.node") 44 | .data(json.nodes) 45 | .enter().append("circle") 46 | .attr("class", "node") 47 | .attr("r", function(d) { return getrank(d.rank); } ) 48 | .style("fill", function(d) { return getcolor(d.rank); }) 49 | .on("dblclick",function(d) { 50 | if ( confirm('Do you want to open '+d.url) ) 51 | window.open(d.url,'_new',''); 52 | d3.event.stopPropagation(); 53 | }) 54 | .call(force.drag); 55 | 56 | node.append("title") 57 | .text(function(d) { return d.url; }); 58 | 59 | force.on("tick", function() { 60 | link.attr("x1", function(d) { return d.source.x; }) 61 | .attr("y1", function(d) { return d.source.y; }) 62 | .attr("x2", function(d) { return d.target.x; }) 63 | .attr("y2", function(d) { return d.target.y; }); 64 | 65 | node.attr("cx", function(d) { return d.x; }) 66 | .attr("cy", function(d) { return d.y; }); 67 | }); 68 | 69 | } 70 | loadData(spiderJson); 71 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/spdump.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | conn = sqlite3.connect('spider.sqlite') 4 | cur = conn.cursor() 5 | 6 | cur.execute('''SELECT COUNT(from_id) AS inbound, old_rank, new_rank, id, url 7 | FROM Pages JOIN Links ON Pages.id = Links.to_id 8 | WHERE html IS NOT NULL 9 | GROUP BY id ORDER BY inbound DESC''') 10 | 11 | count = 0 12 | for row in cur : 13 | if count < 50 : print(row) 14 | count = count + 1 15 | print(count, 'rows.') 16 | cur.close() 17 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/spjson.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | conn = sqlite3.connect('spider.sqlite') 4 | cur = conn.cursor() 5 | 6 | print("Creating JSON output on spider.js...") 7 | howmany = int(input("How many nodes? ")) 8 | 9 | cur.execute('''SELECT COUNT(from_id) AS inbound, old_rank, new_rank, id, url 10 | FROM Pages JOIN Links ON Pages.id = Links.to_id 11 | WHERE html IS NOT NULL AND ERROR IS NULL 12 | GROUP BY id ORDER BY id,inbound''') 13 | 14 | fhand = open('spider.js','w') 15 | nodes = list() 16 | maxrank = None 17 | minrank = None 18 | for row in cur : 19 | nodes.append(row) 20 | rank = row[2] 21 | if maxrank is None or maxrank < rank: maxrank = rank 22 | if minrank is None or minrank > rank : minrank = rank 23 | if len(nodes) > howmany : break 24 | 25 | if maxrank == minrank or maxrank is None or minrank is None: 26 | print("Error - please run sprank.py to compute page rank") 27 | quit() 28 | 29 | fhand.write('spiderJson = {"nodes":[\n') 30 | count = 0 31 | map = dict() 32 | ranks = dict() 33 | for row in nodes : 34 | if count > 0 : fhand.write(',\n') 35 | # print row 36 | rank = row[2] 37 | rank = 19 * ( (rank - minrank) / (maxrank - minrank) ) 38 | fhand.write('{'+'"weight":'+str(row[0])+',"rank":'+str(rank)+',') 39 | fhand.write(' "id":'+str(row[3])+', "url":"'+row[4]+'"}') 40 | map[row[3]] = count 41 | ranks[row[3]] = rank 42 | count = count + 1 43 | fhand.write('],\n') 44 | 45 | cur.execute('''SELECT DISTINCT from_id, to_id FROM Links''') 46 | fhand.write('"links":[\n') 47 | 48 | count = 0 49 | for row in cur : 50 | # print row 51 | if row[0] not in map or row[1] not in map : continue 52 | if count > 0 : fhand.write(',\n') 53 | rank = ranks[row[0]] 54 | srank = 19 * ( (rank - minrank) / (maxrank - minrank) ) 55 | fhand.write('{"source":'+str(map[row[0]])+',"target":'+str(map[row[1]])+',"value":3}') 56 | count = count + 1 57 | fhand.write(']};') 58 | fhand.close() 59 | cur.close() 60 | 61 | print("Open force.html in a browser to view the visualization") 62 | -------------------------------------------------------------------------------- /Course-5- Capstone Retrieving Processing and Visualizing Data with Python/pagerank/spreset.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | conn = sqlite3.connect('spider.sqlite') 4 | cur = conn.cursor() 5 | 6 | cur.execute('''UPDATE Pages SET new_rank=1.0, old_rank=0.0''') 7 | conn.commit() 8 | 9 | cur.close() 10 | 11 | print("All pages set to a rank of 1.0") 12 | -------------------------------------------------------------------------------- /Honor Certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Honor Certificate.pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ashlesh Khajbage 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Python For Everybody Specialization.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Python For Everybody Specialization.pdf -------------------------------------------------------------------------------- /Python for Everybody.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Python for Everybody.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python For Everybody-Coursera 2 | This repository Consists of material And Certificates Earned From Online Learning Course on Coursera from University of Michigan 3 | 4 | [](https://forthebadge.com) [](https://forthebadge.com) [](https://forthebadge.com) 5 | 6 | ## About this Specialization 7 | This Specialization builds on the success of the Python for Everybody course and will introduce fundamental programming concepts including data structures, networked application program interfaces, and databases, using the Python programming language. In the Capstone Project, you’ll use the technologies learned throughout the Specialization to design and create your own applications for data retrieval, processing, and visualization. 8 | 9 | ## Courses In Specilisation 10 | 1. Programming for EveryBody -Getting Started with Python 11 | 2. Python Data Structures 12 | 3. Python Access Wen Data 13 | 4. Python Databases 14 | 5. Capstone : Retrieving, Processing, and Visualizing Data with Python 15 | 16 | ## Offered by 17 |  18 | 19 | University of Michigan 20 | The mission of the University of Michigan is to serve the people of Michigan and the world through preeminence in creating, communicating, preserving and applying knowledge, art, and academic values, and in developing leaders and citizens who will challenge the present and enrich the future. 21 | 22 | ## Instructor 23 |  24 | 25 | **TOP INSTRUCTOR** 26 | Charles Russell Severance 27 | Clinical Professor, 28 | School of Information 29 | 30 | ## Link 31 | > [Specilisation Course](https://www.coursera.org/specializations/python) -------------------------------------------------------------------------------- /Slides And PDF/00-Master.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/00-Master.ppt -------------------------------------------------------------------------------- /Slides And PDF/Anaconda_CheatSheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Anaconda_CheatSheet.pdf -------------------------------------------------------------------------------- /Slides And PDF/Braile-Slide-Summaries-01-10.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Braile-Slide-Summaries-01-10.doc -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-01-Intro.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-01-Intro.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-01/MOOCMap-highres.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-01/MOOCMap-highres.jpg -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-01/RaspberryPi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-01/RaspberryPi.jpg -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-01/Raspi_Colour_R.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-01/Raspi_Colour_R.png -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-01/clown_car.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-01/clown_car.jpg -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-02-Expressions.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-02-Expressions.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-03-Conditional.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-03-Conditional.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-04-Functions.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-04-Functions.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-05-Iterations.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-05-Iterations.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-06-Strings.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-06-Strings.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-07-Files.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-07-Files.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-08-Lists.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-08-Lists.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-09-Dictionaries.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-09-Dictionaries.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-10-Tuples.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-10-Tuples.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-11-Regex.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-11-Regex.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-12-HTML/Wikipedia_File_Utf8webgrowth_svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-12-HTML/Wikipedia_File_Utf8webgrowth_svg.png -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-12-HTML/ascii-cheat-sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-12-HTML/ascii-cheat-sheet.png -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-12-HTML/bytes_decode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-12-HTML/bytes_decode.png -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-12-HTML/str_encode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-12-HTML/str_encode.png -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-12-HTML/unicode-web-site.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-12-HTML/unicode-web-site.png -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-12-HTTP.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-12-HTTP.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-13-WebServices.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-13-WebServices.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-14-Objects.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-14-Objects.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-15-Databases.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-15-Databases.pptx -------------------------------------------------------------------------------- /Slides And PDF/Pythonlearn-16-Data-Viz.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/Pythonlearn-16-Data-Viz.pptx -------------------------------------------------------------------------------- /Slides And PDF/intro-wrapup.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/Slides And PDF/intro-wrapup.pptx -------------------------------------------------------------------------------- /Slides And PDF/program1.py: -------------------------------------------------------------------------------- 1 | print("hello world") -------------------------------------------------------------------------------- /Slides And PDF/pythonlearn-11-Regex-handout.txt: -------------------------------------------------------------------------------- 1 | Python Regular Expression Quick Guide 2 | 3 | ^ Matches the beginning of a line 4 | $ Matches the end of the line 5 | . Matches any character 6 | \s Matches whitespace 7 | \S Matches any non-whitespace character 8 | * Repeats a character zero or more times 9 | *? Repeats a character zero or more times 10 | (non-greedy) 11 | + Repeats a character one or more times 12 | +? Repeats a character one or more times 13 | (non-greedy) 14 | [aeiou] Matches a single character in the listed set 15 | [^XYZ] Matches a single character not in the listed set 16 | [a-z0-9] The set of characters can include a range 17 | ( Indicates where string extraction is to start 18 | ) Indicates where string extraction is to end 19 | -------------------------------------------------------------------------------- /michiganlogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashleshk/Python-For-Everybody-Coursera/ea256e11ac752c1d0ac6f5a766fb6f0d0d15a00d/michiganlogo.jpg --------------------------------------------------------------------------------