Ocean Freight Infra
20. Ocean Freight Infra#
https://ec.europa.eu/eurostat/databrowser/view/mar_go_aa/default/table?lang=en
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns;sns.set()
df = pd.read_csv("assets/ocean-freight-infra/mar_go_aa.tsv", sep="\t", na_values=": ")
df.columns
Index(['direct,unit,rep_mar\time', '2019 ', '2018 ', '2017 ', '2016 ', '2015 ',
'2014 ', '2013 ', '2012 ', '2011 ', '2010 ', '2009 ', '2008 ', '2007 ',
'2006 ', '2005 ', '2004 ', '2003 ', '2002 ', '2001 ', '2000 ', '1999 ',
'1998 ', '1997 '],
dtype='object')
df["port"] = df["direct,unit,rep_mar\\time"].apply(lambda x: x.split(",")[-1])
df[["port", "2019 "]].loc[
(
df.port.apply(lambda x: len(x) > 2)
) & (
df["2019 "] >0
)
].dropna()
port | 2019 | |
---|---|---|
4 | BE_0BEANR | 108697.0 |
6 | BE_0BEGNE | 25665.0 |
9 | BE_0BEOST | 1422.0 |
10 | BE_0BEZEE | 16083.0 |
12 | BG_0BGBOJ | 10622.0 |
... | ... | ... |
5066 | UK_1GBWIC | 29.0 |
5067 | UK_1GBWIS | 106.0 |
5068 | UK_1GBWOR | 319.0 |
5069 | UK_1GBWPT | 3321.0 |
5071 | UK_1GBWTS | 63.0 |
2397 rows × 2 columns