Basins

In [1]:
%load get_loop.py
In [1]:
"""create a dictionary of links traversed for nth fl chuck"""
#takes a file num and creates xpath.json

import json, gc, sys


#goal path[page] = [link1, link2, link3]

#load fln dictionary
net_path = "/Users/mark/Desktop/wiki_v4/"

with open(net_path + "fln.json") as f:
    fln = json.load(f)
def correct_cap(title):
    """returns properly capitalized key, blank otherwise"""
    try:
        fl = fln[title]
        return title
    except:
    #capitalize first letter only
        try:
            fl = fln[title[0].upper() + title[1:]]
            return title[0].upper() + title[1:]
        except:
    #try title case
            try:
                fl = fln[title.title()]
                return title.title()
            except KeyError:
                return ""

def traverse(start):
    """returns list of links traversed"""
    #stop when link is repeated or dead link
    links_traversed = []
    try:
        fl = correct_cap(fln[start])
    except KeyError:
        return "broken link" 
    i = 0
    while fl not in links_traversed and fl !="":
        #maybe add clicks here?
        i += 1
        #break if too large
        if i > 10000: 
            fl = "exceeded 10k click limit"
            break
        #append fl
        links_traversed.append(fl)
        #jump to next link
        fl = correct_cap(fln[fl])
    return links_traversed

            
In [0]:
 
In [3]:
#load top pages
import json
import pandas as pd

results_path = "/Users/mark/Desktop/wiki_v4/"
with open(results_path + "clicks.json") as f:
    visits_dict = json.load(f)
visits_df = pd.DataFrame(visits_dict.items())
visits_df.columns = ['article', 'traversal visits']

What are the basins in the network?

basin path-connected group of articles, ranked by the total number of traversal visits

a basin may not form a cycle (articles may end at an invalid link)

In [3]:
top_articles = visits_df.sort(columns='traversal visits', ascending=False).head(100)
In [4]:
#set_top_loops = [] --> set_top_basins
#top_loops = []  --> top_basins
#top_loop_visits = []  --> top_basin_visits

set_top_basins = []
top_basins = []
top_basin_visits = []

for i, row in top_articles.iterrows():
    basin = traverse(row['article'])
    if set(basin) not in set_top_basins:
        set_top_basins.append(set(basin))
        top_basins.append(basin)
        top_basin_visits.append(row['traversal visits'])
        
    
    
In [5]:
rank = range(len(top_basins))
basins_data = pd.Series(top_basins, top_basin_visits)
basins_df = pd.DataFrame(basins_data, columns=['basin'])
basins_df['rank'] = rank
basins_df = basins_df[['rank','basin']]
basins_df.index.names = ['traversal visits']
basins_df.head(10)
Out[5]:
rank basin
traversal visits
7400884 0 [Awareness, Conscious, Consciousness, Quality ...
7269255 1 [Modern philosophy, Philosophy, Reality, Exist...
7259791 2 [Property (philosophy), Modern philosophy, Phi...
7255122 3 [Quantity, Property (philosophy), Modern philo...
7079148 4 [Mathematics, Quantity, Property (philosophy),...
6622934 5 [Set (mathematics), Mathematics, Quantity, Pro...
6616886 6 [Explanation, Set (mathematics), Mathematics, ...
6616203 7 [Hypothesis, Explanation, Set (mathematics), M...
6614083 8 [Experiment, Hypothesis, Explanation, Set (mat...
6613815 9 [Experience, Experiment, Hypothesis, Explanati...

expanded:

In [6]:
for i,basin in enumerate(top_basins): 
    print i
    print basin
    if i > 10: break
0
[u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)', u'Philosophy', u'Reality', u'Existence']
1
[u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
2
[u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
3
[u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
4
[u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
5
[u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
6
[u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
7
[u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
8
[u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
9
[u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
10
[u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
11
[u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']

Philosophy Basin

The basins are all based around the inner philosophy basin: 'Awareness' 'Conscious' 'Consciousness' 'Quality (philosophy)' 'Philosophy' 'Reality' 'Existence'

What if we look beyond the top 10 basins?

the next 40 basins are...

In [7]:
btop_pages = visits_df.sort(columns='traversal visits', ascending=False).head(500)
bset_top_loops = []
btop_loops = []
btop_loop_visits = []

for i, row in btop_pages.iterrows():
    bloop = traverse(row['article'])
    if set(bloop) not in bset_top_loops:
        bset_top_loops.append(set(bloop))
        btop_loops.append(bloop)
        btop_loop_visits.append(row['traversal visits'])

brank = range(len(btop_loops))
bloops_data = pd.Series(btop_loops, btop_loop_visits)
bloops_df = pd.DataFrame(bloops_data, columns=['basin'])
bloops_df['rank'] = brank
bloops_df = bloops_df[['rank','basin']]
bloops_df.index.names = ['traversal visits']
bloops_df[10:50]
Out[7]:
rank basin
traversal visits
6613248 10 [Fact, Experience, Experiment, Hypothesis, Exp...
6444926 11 [Knowledge, Fact, Experience, Experiment, Hypo...
4633960 12 [Science, Knowledge, Fact, Experience, Experim...
3400690 13 [Natural science, Science, Knowledge, Fact, Ex...
2028827 14 [Biology, Natural science, Science, Knowledge,...
2027606 15 [Tribe (biology), Biology, Natural science, Sc...
2027495 16 [Hominini, Tribe (biology), Biology, Natural s...
1509110 17 [Human, Hominini, Tribe (biology), Biology, Na...
1412646 18 []
1401610 19 [Community]
1335477 20 [World, Human, Hominini, Tribe (biology), Biol...
1297144 21 [Earth, World, Human, Hominini, Tribe (biology...
910619 22 [Geography, Earth, World, Human, Hominini, Tri...
910554 23 [Human geography, Geography, Earth, World, Hum...
910528 24 [Political geography, Human geography, Geograp...
858725 25 [State (polity), Community]
858699 26 [Political union, State (polity), Community]
723998 27 [Federation, Political union, State (polity), ...
645237 28 [Federal republic, Federation, Political union...
466333 29 [Country, Political geography, Human geography...
425296 30 [Data, Set (mathematics), Mathematics, Quantit...
417078 31 [Social science, Science, Knowledge, Fact, Exp...
413946 32 [Organism, Biology, Natural science, Science, ...
413936 33 [Biological interaction, Organism, Biology, Na...
413358 34 [Competition (biology), Biological interaction...
407781 35 [Competition, Competition (biology), Biologica...
404716 36 [Landmass]
390890 37 [Information, Data, Set (mathematics), Mathema...
379202 38 [Power (social and political), Social science,...
379191 39 [Political power, Power (social and political)...
379184 40 [Centralized government, Political power, Powe...
312074 41 [Behavior, Organism, Biology, Natural science,...
311638 42 [Human behavior, Behavior, Organism, Biology, ...
308494 43 [Physics, Natural science, Science, Knowledge,...
308265 44 [Communication, Information, Data, Set (mathem...
308137 45 [Dimension, Physics, Natural science, Science,...
305052 46 [Outline of natural science, Natural science, ...
304739 47 [Outline of physical science, Outline of natur...
304034 48 [Physical science, Outline of physical science...
289004 49 [Language, Human, Hominini, Tribe (biology), B...

*rank 18 are invalid links

i.e., pages linking to files, external pages, another part of the same article, wiktionary etc.

the expanded edition:

In [8]:
for i, bloop in enumerate(bloops_df.basin[10:50]):
    print i
    print bloop
0
[u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
1
[u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
2
[u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
3
[u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
4
[u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
5
[u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
6
[u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
7
[u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
8
[]
9
[u'Community']
10
[u'World', u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
11
[u'Earth', u'World', u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
12
[u'Geography', u'Earth', u'World', u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
13
[u'Human geography', u'Geography', u'Earth', u'World', u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
14
[u'Political geography', u'Human geography', u'Geography', u'Earth', u'World', u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
15
[u'State (polity)', u'Community']
16
[u'Political union', u'State (polity)', u'Community']
17
[u'Federation', u'Political union', u'State (polity)', u'Community']
18
[u'Federal republic', u'Federation', u'Political union', u'State (polity)', u'Community']
19
[u'Country', u'Political geography', u'Human geography', u'Geography', u'Earth', u'World', u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
20
[u'Data', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
21
[u'Social science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
22
[u'Organism', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
23
[u'Biological interaction', u'Organism', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
24
[u'Competition (biology)', u'Biological interaction', u'Organism', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
25
[u'Competition', u'Competition (biology)', u'Biological interaction', u'Organism', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
26
[u'Landmass']
27
[u'Information', u'Data', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
28
[u'Power (social and political)', u'Social science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
29
[u'Political power', u'Power (social and political)', u'Social science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
30
[u'Centralized government', u'Political power', u'Power (social and political)', u'Social science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
31
[u'Behavior', u'Organism', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
32
[u'Human behavior', u'Behavior', u'Organism', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
33
[u'Physics', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
34
[u'Communication', u'Information', u'Data', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
35
[u'Dimension', u'Physics', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
36
[u'Outline of natural science', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
37
[u'Outline of physical science', u'Outline of natural science', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
38
[u'Physical science', u'Outline of physical science', u'Outline of natural science', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']
39
[u'Language', u'Human', u'Hominini', u'Tribe (biology)', u'Biology', u'Natural science', u'Science', u'Knowledge', u'Fact', u'Experience', u'Experiment', u'Hypothesis', u'Explanation', u'Set (mathematics)', u'Mathematics', u'Quantity', u'Property (philosophy)', u'Modern philosophy', u'Philosophy', u'Reality', u'Existence', u'Awareness', u'Conscious', u'Consciousness', u'Quality (philosophy)']

What are the top non-philosphy basins?

In [9]:
for i, bloop in enumerate(bloops_df.basin):
    if "Philosophy" not in bloop:
        print bloops_df[bloops_df['rank'] == i]
                  rank basin
traversal visits            
1412646             18    []
                  rank        basin
traversal visits                   
1401610             19  [Community]
                  rank                        basin
traversal visits                                   
858725              25  [State (polity), Community]
                  rank                                         basin
traversal visits                                                    
858699              26  [Political union, State (polity), Community]
                  rank                                              basin
traversal visits                                                         
723998              27  [Federation, Political union, State (polity), ...
                  rank                                              basin
traversal visits                                                         
645237              28  [Federal republic, Federation, Political union...
                  rank       basin
traversal visits                  
404716              36  [Landmass]
                  rank                                              basin
traversal visits                                                         
159540              72  [United States, Federal republic, Federation, ...
                  rank                                              basin
traversal visits                                                         
118693             106  [United States of America, United States, Fede...
                  rank                  basin
traversal visits                             
111743             109  [Continent, Landmass]
                  rank                                    basin
traversal visits                                               
94299              120  [Government, State (polity), Community]
                  rank                          basin
traversal visits                                     
85434              127  [Europe, Continent, Landmass]
                  rank                                       basin
traversal visits                                                  
83942              128  [Unitary state, State (polity), Community]
                  rank                                              basin
traversal visits                                                         
77920              133  [Executive (government), Government, State (po...
                  rank                                              basin
traversal visits                                                         
77535              134  [Public policy, Executive (government), Govern...
                  rank                                          basin
traversal visits                                                     
70876              139  [Eastern Europe, Europe, Continent, Landmass]
                  rank                                              basin
traversal visits                                                         
69477              145  [Public administration, Public policy, Executi...
                  rank                                              basin
traversal visits                                                         
54905              172  [County (United States), United States, Federa...
                  rank                                         basin
traversal visits                                                    
51048              187  [Australia (continent), Continent, Landmass]
                  rank                                              basin
traversal visits                                                         
46379              191  [Central Europe, Eastern Europe, Europe, Conti...
                  rank                                      basin
traversal visits                                                 
44686              193  [Constitution, State (polity), Community]
                  rank                                              basin
traversal visits                                                         
44685              194  [Constituent state, Constitution, State (polit...
                  rank                                              basin
traversal visits                                                         
44684              195  [Constituent entity, Constituent state, Consti...
                  rank                           basin
traversal visits                                      
43487              198  [Eurasia, Continent, Landmass]
                  rank                 basin
traversal visits                            
42604              205  [Federal government]
                  rank                                              basin
traversal visits                                                         
40235              212  [Form of government, Government, State (polity...
                  rank            basin
traversal visits                       
39988              213  [Belief system]
                  rank                                 basin
traversal visits                                            
36428              233  [South America, Continent, Landmass]
                  rank                    basin
traversal visits                               
35079              238  [Terrestrial ecoregion]
                  rank                                              basin
traversal visits                                                         
34566              244  [Federated state, Constitution, State (polity)...
                  rank                                              basin
traversal visits                                                         
34262              247  [Democracy, Form of government, Government, St...
                  rank                               basin
traversal visits                                          
33685              252  [Landscape, Terrestrial ecoregion]
                  rank                                          basin
traversal visits                                                     
32333              263  [Southeast Europe, Balkan peninsula, Balkans]
                  rank                                              basin
traversal visits                                                         
31889              265  [State (administrative division), Federated st...
                  rank                    basin
traversal visits                               
31000              268  [Presentation, Lecture]
                  rank                            basin
traversal visits                                       
30716              272  [Report, Presentation, Lecture]
                  rank                                              basin
traversal visits                                                         
29795              279  [Geomorphology, Landscape, Terrestrial ecoregion]
                  rank                                              basin
traversal visits                                                         
29350              284  [Germany, Federation, Political union, State (...
                  rank                                              basin
traversal visits                                                         
29302              285  [Tree of life (biology), Tree of life (disambi...
                  rank                                              basin
traversal visits                                                         
29265              286  [Tree of life (science), Tree of life (biology...
                  rank                                              basin
traversal visits                                                         
29131              288  [Local government, Public administration, Publ...
                  rank    basin
traversal visits               
27843              297  [India]
                  rank                          basin
traversal visits                                     
27382              300  [Island, Continent, Landmass]
                  rank                                              basin
traversal visits                                                         
25952              308  [Administrative centre, Local government, Publ...
                  rank                                              basin
traversal visits                                                         
25863              309  [Administrative center, Administrative centre,...
                  rank                                              basin
traversal visits                                                         
25338              313  [Landform, Geomorphology, Landscape, Terrestri...
                  rank                      basin
traversal visits                                 
24684              321  [Census-Designated Place]
                  rank              basin
traversal visits                         
22429              342  [Built structure]
                  rank  basin
traversal visits             
21926              345  [Gas]
                  rank                                              basin
traversal visits                                                         
20660              356  [Dictatorship, Form of government, Government,...
                  rank                                              basin
traversal visits                                                         
20572              359  [Clade, Tree of life (science), Tree of life (...
                  rank                                              basin
traversal visits                                                         
20566              360  [Dictator, Dictatorship, Form of government, G...

expanded:

In [10]:
for i, bloop in enumerate(bloops_df.basin):
    if "Philosophy" not in bloop:
        print "rank ", i
        print bloop
rank  18
[]
rank  19
[u'Community']
rank  25
[u'State (polity)', u'Community']
rank  26
[u'Political union', u'State (polity)', u'Community']
rank  27
[u'Federation', u'Political union', u'State (polity)', u'Community']
rank  28
[u'Federal republic', u'Federation', u'Political union', u'State (polity)', u'Community']
rank  36
[u'Landmass']
rank  72
[u'United States', u'Federal republic', u'Federation', u'Political union', u'State (polity)', u'Community']
rank  106
[u'United States of America', u'United States', u'Federal republic', u'Federation', u'Political union', u'State (polity)', u'Community']
rank  109
[u'Continent', u'Landmass']
rank  120
[u'Government', u'State (polity)', u'Community']
rank  127
[u'Europe', u'Continent', u'Landmass']
rank  128
[u'Unitary state', u'State (polity)', u'Community']
rank  133
[u'Executive (government)', u'Government', u'State (polity)', u'Community']
rank  134
[u'Public policy', u'Executive (government)', u'Government', u'State (polity)', u'Community']
rank  139
[u'Eastern Europe', u'Europe', u'Continent', u'Landmass']
rank  145
[u'Public administration', u'Public policy', u'Executive (government)', u'Government', u'State (polity)', u'Community']
rank  172
[u'County (United States)', u'United States', u'Federal republic', u'Federation', u'Political union', u'State (polity)', u'Community']
rank  187
[u'Australia (continent)', u'Continent', u'Landmass']
rank  191
[u'Central Europe', u'Eastern Europe', u'Europe', u'Continent', u'Landmass']
rank  193
[u'Constitution', u'State (polity)', u'Community']
rank  194
[u'Constituent state', u'Constitution', u'State (polity)', u'Community']
rank  195
[u'Constituent entity', u'Constituent state', u'Constitution', u'State (polity)', u'Community']
rank  198
[u'Eurasia', u'Continent', u'Landmass']
rank  205
[u'Federal government']
rank  212
[u'Form of government', u'Government', u'State (polity)', u'Community']
rank  213
[u'Belief system']
rank  233
[u'South America', u'Continent', u'Landmass']
rank  238
[u'Terrestrial ecoregion']
rank  244
[u'Federated state', u'Constitution', u'State (polity)', u'Community']
rank  247
[u'Democracy', u'Form of government', u'Government', u'State (polity)', u'Community']
rank  252
[u'Landscape', u'Terrestrial ecoregion']
rank  263
[u'Southeast Europe', u'Balkan peninsula', u'Balkans']
rank  265
[u'State (administrative division)', u'Federated state', u'Constitution', u'State (polity)', u'Community']
rank  268
[u'Presentation', u'Lecture']
rank  272
[u'Report', u'Presentation', u'Lecture']
rank  279
[u'Geomorphology', u'Landscape', u'Terrestrial ecoregion']
rank  284
[u'Germany', u'Federation', u'Political union', u'State (polity)', u'Community']
rank  285
[u'Tree of life (biology)', u'Tree of life (disambiguation)', u'Tree of life']
rank  286
[u'Tree of life (science)', u'Tree of life (biology)', u'Tree of life (disambiguation)', u'Tree of life']
rank  288
[u'Local government', u'Public administration', u'Public policy', u'Executive (government)', u'Government', u'State (polity)', u'Community']
rank  297
[u'India']
rank  300
[u'Island', u'Continent', u'Landmass']
rank  308
[u'Administrative centre', u'Local government', u'Public administration', u'Public policy', u'Executive (government)', u'Government', u'State (polity)', u'Community']
rank  309
[u'Administrative center', u'Administrative centre', u'Local government', u'Public administration', u'Public policy', u'Executive (government)', u'Government', u'State (polity)', u'Community']
rank  313
[u'Landform', u'Geomorphology', u'Landscape', u'Terrestrial ecoregion']
rank  321
[u'Census-Designated Place']
rank  342
[u'Built structure']
rank  345
[u'Gas']
rank  356
[u'Dictatorship', u'Form of government', u'Government', u'State (polity)', u'Community']
rank  359
[u'Clade', u'Tree of life (science)', u'Tree of life (biology)', u'Tree of life (disambiguation)', u'Tree of life']
rank  360
[u'Dictator', u'Dictatorship', u'Form of government', u'Government', u'State (polity)', u'Community']

In [ ]: