In [4]:
%load_ext cypher
%matplotlib inline
import pandas as pd
In [30]:
%cypher match (n) return count(*) as num_nodes
Out[30]:
In [38]:
%cypher match (n:tweet) return count (*) as num_tweets
Out[38]:
In [39]:
%cypher match (n:user) return count (*) as num_users
Out[39]:
In [40]:
%cypher match (n:hashtag) return count (*) as num_hashtags
Out[40]:
In [36]:
%cypher match (n)-[r]->() return count(*) as num_edges
Out[36]:
In [10]:
top_tweets = %cypher match (n:tweet)-[r]-(m:tweet) return n.tid, n.text, count(r) as deg order by deg desc limit 10
In [11]:
top_tweets.get_dataframe()
Out[11]:
In [12]:
top_tags = %cypher match (n:hashtag)-[r]-(m) return n.hashtag, count(r) as deg order by deg desc limit 10
In [13]:
top_tags.get_dataframe()
Out[13]:
In [14]:
top_users = %cypher match (n:user)-[r]-(m) return n.uid, n.screen_name, count(r) as deg order by deg desc limit 10
In [15]:
top_users.get_dataframe()
Out[15]:
In [41]:
top_langs = %cypher match (n:tweet) where n.lang is not null return distinct n.lang, count(n.lang) as num_tweets order by num_tweets desc
In [42]:
top_langs.get_dataframe().head(20)
Out[42]:
In [24]:
top_locs = %cypher match (n:tweet) where n.full_name is not null return distinct n.full_name, count(n.full_name) as num_tweets order by num_tweets desc
In [25]:
top_locs.get_dataframe().head(20)
Out[25]:
In [26]:
top_countries = %cypher match (n:tweet) where n.country is not null return distinct n.country, count(n.country) as num_tweets order by num_tweets desc
In [28]:
top_countries.get_dataframe().head(20)
Out[28]: