This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# ## Data Analysis using Pandas | |
# Pandas has become the defacto package for data analysis. In this workshop, we are going to use the basics of pandas to analyze the interests of today's group. We are going to use meetup.com's api and fetch the list of interests that are listed in each of our meetup.com profile. We will compute which interests are common, which are uncommon, and find out how we can use topics of common interest to form teams for project night. | |
# | |
# Lets get started by importing the essentials. You would need meetup.com's python api and pandas installed. | |
# In[ ]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!pip install meetup-api | |
import meetup.api | |
import pandas as pd | |
print("See you at project night!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square(*l): print map(lamda x:x*x, l) | |
>>> square(1,2,3) | |
[1, 4, 9] | |
>>> square([1,2,3]) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "<stdin>", line 1, in f | |
File "<stdin>", line 1, in <lambda> | |
TypeError: can't multiply sequence by non-int of type 'list' | |
>>> f(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select count(*)/3573.0*100.0from HospitalsOnTwitter h, survey_names s where h.organization=s.name; | |
8.22837951301427 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twython import Twython, TwythonAuthError, TwythonError | |
from pprint import pprint | |
import json, time | |
import sqlite3, mysql.connector as sql | |
def connect(): | |
db_params = { | |
'user' : "", | |
'password' : "", | |
'host' : "192.168.1.106", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\utilities>mysql.exe --defaults-extra-file="c:\users\tathag~1\appdata\local\temp\tmpcwv283.cnf" --host=localhost --user=root --password --port=3306 --default-character-set=latin2 --comments --database=multiwordnet < "C:\\Users\\Tathagata\\projects\\NewTracelabData\\EX3\\cyptichash\\MWN_1.5.0\\italian_index.sql" | |
Could not open required defaults file: c:\users\tathag~1\appdata\local\temp\tmpcwv283.cnf | |
Fatal error in defaults handling. Program aborted | |
Enter password: ******** | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>>import chardet | |
>>>chardet.detect("ombrosità") | |
{'confidence': 0.8444448197532533, 'encoding': 'ISO-8859-2'} | |
>>>chardet.detect("bebè") | |
{'confidence': 0.63333361481494, 'encoding': 'ISO-8859-2'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running: mysql.exe --defaults-extra-file="c:\users\tathag~1\appdata\local\temp\tmp531z_l.cnf" --host=localhost --user=root --port=3306 **--default-character-set=utf8** --comments --database=multiwordnet < "C:\\Users\\Tathagata\\projects\\NewTracelabData\\EX3\\cryptichash\\MWN_1.5.0\\italian_index.sql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR 1062 (23000) at line 3053: Duplicate entry 'bebé' for key 'PRIMARY | |
INSERT INTO italian_index VALUES ('bebè','n#07094006',NULL,NULL,NULL); | |
INSERT INTO italian_index VALUES ('bebé','n#07094006',NULL,NULL,NULL); |
NewerOlder