Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
add visualisation avec Matplotlib
Browse files Browse the repository at this point in the history
  • Loading branch information
martindaniel4 committed Mar 1, 2015
1 parent 0c888fb commit cf0388e
Show file tree
Hide file tree
Showing 6 changed files with 1,435 additions and 436 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"metadata": {
"name": ""
"name": "",
"signature": "sha256:f89305eba6e4416742f5de9307879c02d51be8e64e9dddab07e69fd94c9596a1"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand Down Expand Up @@ -275,8 +276,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 3
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -296,8 +296,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 4
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -316,17 +315,7 @@
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"['content', 'meta']\n",
"[u'search_metadata', u'statuses']\n"
]
}
],
"prompt_number": 5
"outputs": []
},
{
"cell_type": "code",
Expand All @@ -336,16 +325,7 @@
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"100\n"
]
}
],
"prompt_number": 6
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -364,16 +344,7 @@
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[u'contributors', u'truncated', u'text', u'in_reply_to_status_id', u'id', u'favorite_count', u'source', u'retweeted', u'coordinates', u'entities', u'in_reply_to_screen_name', u'in_reply_to_user_id', u'retweet_count', u'id_str', u'favorited', u'user', u'geo', u'in_reply_to_user_id_str', u'lang', u'created_at', u'in_reply_to_status_id_str', u'place', u'metadata']\n"
]
}
],
"prompt_number": 412
"outputs": []
},
{
"cell_type": "heading",
Expand All @@ -396,8 +367,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 7
"outputs": []
},
{
"cell_type": "code",
Expand All @@ -411,8 +381,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -431,8 +400,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 8
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -449,98 +417,7 @@
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 9,
"text": [
"{u'contributors': None,\n",
" u'coordinates': None,\n",
" u'created_at': u'Tue Feb 24 14:16:19 +0000 2015',\n",
" u'entities': {u'hashtags': [{u'indices': [104, 113], u'text': u'DirectPR'}],\n",
" u'symbols': [],\n",
" u'urls': [{u'display_url': u'elysee.fr/video/xu30kq',\n",
" u'expanded_url': u'http://www.elysee.fr/video/xu30kq',\n",
" u'indices': [114, 136],\n",
" u'url': u'http://t.co/PfCSjUFDLJ'}],\n",
" u'user_mentions': [{u'id': 18814998,\n",
" u'id_str': u'18814998',\n",
" u'indices': [45, 55],\n",
" u'name': u'Fran\\xe7ois Hollande',\n",
" u'screen_name': u'fhollande'},\n",
" {u'id': 18762875,\n",
" u'id_str': u'18762875',\n",
" u'indices': [61, 73],\n",
" u'name': u'Matteo Renzi',\n",
" u'screen_name': u'matteorenzi'}]},\n",
" u'favorite_count': 7,\n",
" u'favorited': False,\n",
" u'geo': None,\n",
" u'id': 570225713363738625,\n",
" u'id_str': u'570225713363738625',\n",
" u'in_reply_to_screen_name': None,\n",
" u'in_reply_to_status_id': None,\n",
" u'in_reply_to_status_id_str': None,\n",
" u'in_reply_to_user_id': None,\n",
" u'in_reply_to_user_id_str': None,\n",
" u'lang': u'fr',\n",
" u'place': None,\n",
" u'possibly_sensitive': False,\n",
" u'retweet_count': 22,\n",
" u'retweeted': False,\n",
" u'source': u'<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>',\n",
" u'text': u'Suivez la d\\xe9claration conjointe du pr\\xe9sident @fhollande avec @matteorenzi, pr\\xe9sident du Conseil italien #DirectPR http://t.co/PfCSjUFDLJ',\n",
" u'truncated': False,\n",
" u'user': {u'contributors_enabled': False,\n",
" u'created_at': u'Mon Oct 13 06:23:33 +0000 2008',\n",
" u'default_profile': False,\n",
" u'default_profile_image': False,\n",
" u'description': u\"Bienvenue sur le compte officiel de la Pr\\xe9sidence de la R\\xe9publique fran\\xe7aise et du Palais de l'\\xc9lys\\xe9e. Livetweets \\xe0 suivre sur #DirectPR .\",\n",
" u'entities': {u'description': {u'urls': []},\n",
" u'url': {u'urls': [{u'display_url': u'elysee.fr',\n",
" u'expanded_url': u'http://www.elysee.fr',\n",
" u'indices': [0, 22],\n",
" u'url': u'http://t.co/tXWVLyZ9Ok'}]}},\n",
" u'favourites_count': 0,\n",
" u'follow_request_sent': False,\n",
" u'followers_count': 656510,\n",
" u'following': False,\n",
" u'friends_count': 184,\n",
" u'geo_enabled': True,\n",
" u'id': 16717501,\n",
" u'id_str': u'16717501',\n",
" u'is_translation_enabled': False,\n",
" u'is_translator': False,\n",
" u'lang': u'fr',\n",
" u'listed_count': 5053,\n",
" u'location': u'France',\n",
" u'name': u'\\xc9lys\\xe9e',\n",
" u'notifications': False,\n",
" u'profile_background_color': u'FCFCFC',\n",
" u'profile_background_image_url': u'http://pbs.twimg.com/profile_background_images/435457152178597889/_lFlH6mS.png',\n",
" u'profile_background_image_url_https': u'https://pbs.twimg.com/profile_background_images/435457152178597889/_lFlH6mS.png',\n",
" u'profile_background_tile': False,\n",
" u'profile_banner_url': u'https://pbs.twimg.com/profile_banners/16717501/1424441417',\n",
" u'profile_image_url': u'http://pbs.twimg.com/profile_images/554623459423031296/bzNTGLYo_normal.jpeg',\n",
" u'profile_image_url_https': u'https://pbs.twimg.com/profile_images/554623459423031296/bzNTGLYo_normal.jpeg',\n",
" u'profile_link_color': u'4260A2',\n",
" u'profile_location': None,\n",
" u'profile_sidebar_border_color': u'FFFFFF',\n",
" u'profile_sidebar_fill_color': u'E9E9E8',\n",
" u'profile_text_color': u'434544',\n",
" u'profile_use_background_image': True,\n",
" u'protected': False,\n",
" u'screen_name': u'Elysee',\n",
" u'statuses_count': 9978,\n",
" u'time_zone': u'Paris',\n",
" u'url': u'http://t.co/tXWVLyZ9Ok',\n",
" u'utc_offset': 3600,\n",
" u'verified': True}}"
]
}
],
"prompt_number": 9
"outputs": []
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -576,8 +453,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 10
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -594,8 +470,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 11
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -618,17 +493,7 @@
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"3239\n",
"[u'contributors', u'truncated', u'text', u'in_reply_to_status_id', u'id', u'favorite_count', u'source', u'retweeted', u'coordinates', u'entities', u'in_reply_to_screen_name', u'id_str', u'retweet_count', u'in_reply_to_user_id', u'favorited', u'user', u'geo', u'in_reply_to_user_id_str', u'possibly_sensitive', u'lang', u'created_at', u'in_reply_to_status_id_str', u'place']\n"
]
}
],
"prompt_number": 424
"outputs": []
},
{
"cell_type": "heading",
Expand All @@ -638,14 +503,6 @@
"Analyser l'\u00e9volution des tweets dans le temps"
]
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"/!\\ voir Focus : 02 - les s\u00e9ries temporelles avec Python "
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -654,7 +511,7 @@
"\n",
"Au moment de cr\u00e9er notre DataFrame, nous pouvons donc sp\u00e9cifier les colonnes \u00e0 utiliser. \n",
"\n",
"Faire \u00e9galement attention aux Index. Nous allons travailler avec un set de donn\u00e9es temporel, il advient de bien sp\u00e9cifier l'index que nous allons utiliser (Time series Index vs Integer Index)"
"Faire \u00e9galement attention aux Index. Nous allons travailler avec un set de donn\u00e9es temporel, il advient de bien sp\u00e9cifier l'index que nous allons utiliser : Voir ***03 - Focus s\u00e9rie temporelles avec Python***"
]
},
{
Expand All @@ -674,8 +531,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 12
"outputs": []
},
{
"cell_type": "code",
Expand All @@ -687,17 +543,7 @@
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 13,
"text": [
"<matplotlib.text.Text at 0x111947810>"
]
}
],
"prompt_number": 13
"outputs": []
},
{
"cell_type": "heading",
Expand Down Expand Up @@ -754,8 +600,7 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 14
"outputs": []
},
{
"cell_type": "markdown",
Expand All @@ -768,31 +613,19 @@
"cell_type": "code",
"collapsed": false,
"input": [
"print elysee_df.groupby('mentions').size().order(ascending=False)[0:10]"
"elysee_df.groupby('mentions').size().order(ascending=False)[0:10]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"mentions\n",
"@fhollande 1623\n",
"@SLeFoll 87\n",
"@najatvb 49\n",
"@gouvernementFR 31\n",
"@fil_gouv 30\n",
"@francediplo 17\n",
"@70eNormandie 13\n",
"@BritishMonarchy 13\n",
"@Defense_gouv 12\n",
"@manuelvalls 11\n",
"dtype: int64\n"
]
}
],
"prompt_number": 15
"outputs": []
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"A vous :"
]
},
{
"cell_type": "markdown",
Expand Down
Loading

0 comments on commit cf0388e

Please sign in to comment.