Skip to content

Instantly share code, notes, and snippets.

View AlessandraSozzi's full-sized avatar

Alessandra Sozzi AlessandraSozzi

  • IMF
  • Washington, DC
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test API</title>
</head>
<body>
<script src="https://d3js.org/d3.v5.js"></script>
<script>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AlessandraSozzi
AlessandraSozzi / README.md
Last active February 8, 2017 16:27
README structure

Project Title

Overview

At the top of the file there should be a short introduction and/ or overview that explains what the project is.

  • Explanation of the application and its purpose. Answer the questions:
    • What is the motivation behind the creation of the project? This should explain why the project exists.
    • Why is this project relevant to the user?
    • What purpose does it serve?
@AlessandraSozzi
AlessandraSozzi / index.html
Last active October 24, 2016 14:12
Measuring Sustainability Reporting using Web Scraping and Natural Language Processing
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<title>LDAvis</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<style type="text/css">
/*!
@AlessandraSozzi
AlessandraSozzi / extract_list.py
Last active July 6, 2016 10:09
Script to scrape data from i-know-uk.com
from selenium import webdriver
from bs4 import BeautifulSoup
import time
import pandas as pd
def load_website(u):
driver_path = '/Users/Alessandra/Documents/WebDriver/chromedriver'
d = webdriver.Chrome(driver_path)
d.get(u)
@AlessandraSozzi
AlessandraSozzi / createTwitterFriendsGraph.py
Last active July 3, 2016 12:17
Create a graph of your Twitter Friends (based on who follows who)
import tweepy
import os
import pandas as pd
import time
import json
import codecs
# Authentication params
APP_NAME = ''
@AlessandraSozzi
AlessandraSozzi / nextResults.py
Last active July 3, 2016 12:06
Google Custom Search API - Get Next pages up to 100 results
from search import SearchWithGoogle
import time
import pandas as pd
import config
gs = SearchWithGoogle("5Ps People, Planet, Partnership, Peace, and Prosperity")
gr = gs.search()
@AlessandraSozzi
AlessandraSozzi / TW_WGS84.geojson
Last active April 22, 2016 10:27
Outliers magnitude vs Consumption
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: It looks like row 16 should actually have 12 columns, instead of 4. in line 15.
Liability,Instrument,Asset,Y2006,Y2007,Y2008,Y2009,Y2010,Y2011,Y2012,Y2013,Y2014 MFI,Currency,PC,0.58,0.63,0.53,0.54,0.57,0.57,0.49,0.55,0.55 MFI,Currency,RoW,1.35,1.4,1.37,1.25,1.3,1.31,1.38,1.43,1.51 MFI,Currency,unknown,47.03,47.99,50.44,56.88,58.8,62,65.33,67.45,71.01 CG,Currency,PC,0.06,0.07,0.06,0.06,0.06,0.06,0.05,0.06,0.06 CG,Currency,RoW,0.15,0.16,0.15,0.14,0.14,0.15,0.15,0.16,0.17 CG,Currency,unknown,3.58,3.63,3.74,3.8,3.87,3.9,4.06,4.08,4.26 RoW,Currency,PNFC,0.54,0.59,0.56,0.48,0.5,0.5,0.51,0.48,0.56 RoW,Currency,MFI,0.16,0.19,0.38,0.31,0.15,0.12,0.12,0.15,0.19 unknown,Currency,PNFC,3.28,3.49,3.76,4.09,4.26,4.48,4.72,4.94,5.22 unknown,Currency,MFI,9.82,8.38,7.63,12.41,10.12,10.64,11.18,10.72,11.19 unknown,Currency,OFI,0.08,0.08,0.08,0.08,0.08,0.08,0.08,0.08,0.08 unknown,Currency,HH+NPISH,37.43,39.66,42.71,44.09,48.21,50.69,53.41,55.78,58.78 MFI,Deposits,PC,6,3.9,2.64,2.6,2.44,3.51,2.35,2.91,2.78 MFI,Deposits,PNFC,247.44,269.97,263.27,278.38,299.34,293.32,312.84,331.32,357.69 MFI,Deposits,MFI,1282.
We can make this file beautiful and searchable if this error is corrected: It looks like row 16 should actually have 12 columns, instead of 4. in line 15.
Liability,Instrument,Asset,Y2006,Y2007,Y2008,Y2009,Y2010,Y2011,Y2012,Y2013,Y2014 MFI,Currency,PC,0.58,0.63,0.53,0.54,0.57,0.57,0.49,0.55,0.55 MFI,Currency,RoW,1.35,1.4,1.37,1.25,1.3,1.31,1.38,1.43,1.51 MFI,Currency,Unknown,47.03,47.99,50.44,56.88,58.8,62,65.33,67.45,71.01 CG,Currency,PC,0.06,0.07,0.06,0.06,0.06,0.06,0.05,0.06,0.06 CG,Currency,RoW,0.15,0.16,0.15,0.14,0.14,0.15,0.15,0.16,0.17 CG,Currency,Unknown,3.58,3.63,3.74,3.8,3.87,3.9,4.06,4.08,4.26 RoW,Currency,PNFC,0.54,0.59,0.56,0.48,0.5,0.5,0.51,0.48,0.56 RoW,Currency,MFI,0.16,0.19,0.38,0.31,0.15,0.12,0.12,0.15,0.19 Unknown,Currency,PNFC,3.28,3.49,3.76,4.09,4.26,4.48,4.72,4.94,5.22 Unknown,Currency,MFI,9.82,8.38,7.63,12.41,10.12,10.64,11.18,10.72,11.19 Unknown,Currency,OFI,0.08,0.08,0.08,0.08,0.08,0.08,0.08,0.08,0.08 Unknown,Currency,HH+NPISH,37.43,39.66,42.71,44.09,48.21,50.69,53.41,55.78,58.78 MFI,Deposits,PC,6,3.9,2.64,2.6,2.44,3.51,2.35,2.91,2.78 MFI,Deposits,PNFC,247.44,269.97,263.27,278.38,299.34,293.32,312.84,331.32,357.69 MFI,Deposits,MFI,1282.