You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/exploratory_notebooks/world_trade/world_trade_network.md
+18-26Lines changed: 18 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,12 @@ import networkx as nx
25
25
import pandas as pd
26
26
import matplotlib as mpl
27
27
import matplotlib.pyplot as plt
28
-
from mpl_toolkits.basemap import Basemap as Basemap
28
+
try:
29
+
from mpl_toolkits.basemap import Basemap as Basemap
30
+
importBasemap = True
31
+
except:
32
+
print("Basemap cannot be imported, so Geographic visualizations will be plotted without underlying cartograph.")
33
+
importBasemap = False
29
34
```
30
35
31
36
For the sake of convenience and scope of this tutorial, the data for trade flows of three product categories - Natural Gas (Hs6: 271111), Coffee (Hs6: 090111) and Diamonds (Hs6: 710210) was extracted to three separate CSV files. These are now imported as pandas dataframe, from where they can be converted to NetworkX Graph objects.
0 commit comments