Pandas

"pandas" is a Python package providing fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data both easy and intuitive. It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python. Additionally, it has the broader goal of becoming the most powerful and flexible open source data analysis / manipulation tool available in any language. It is already well on its way toward this goal.

The convention is to import pandas and set "pd" as its package alias.


In [2]:
import pandas as pd

1-D series


In [4]:
s = pd.Series([3, 5, 67, 2, 4])
s


Out[4]:
0     3
1     5
2    67
3     2
4     4
dtype: int64

In [7]:
s.name = "OneDArray"
s


Out[7]:
0     3
1     5
2    67
3     2
4     4
Name: OneDArray, dtype: int64

In [4]:
s.index


Out[4]:
RangeIndex(start=0, stop=5, step=1)

In [5]:
s.values


Out[5]:
array([ 3,  5, 67,  2,  4])

In [6]:
s.sum()


Out[6]:
81

In [7]:
s.min()


Out[7]:
2

In [8]:
s.count()


Out[8]:
5

In [9]:
s * 3


Out[9]:
0      9
1     15
2    201
3      6
4     12
dtype: int64

In [10]:
s.sort_values()


Out[10]:
3     2
0     3
4     4
1     5
2    67
dtype: int64

In [11]:
s.value_counts()


Out[11]:
4     1
5     1
67    1
3     1
2     1
dtype: int64

In [12]:
s.abs?

DataFrame


In [3]:
eu = pd.read_csv('data/eu_revolving_loans.csv',
                header=[1,2,3], index_col=0, skiprows=1)

In [6]:
eu.tail(4)


Out[6]:
Austria Belgium Cyprus Germany Estonia Spain Finland France Greece (GR) Ireland Italy Lithuania Luxembourg Latvia Malta Netherlands Portugal Slovenia Slovakia Euro area (changing composition)
Collection: End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) Average of observations through period (A)
Period\Unit: [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ]
2000Apr 8.99 10.82 NaN 10.21 - 13.01 10.54 11.03 20.46 13.08 9.18 NaN NaN NaN NaN 8.44 9.2 NaN NaN 10.33
2000Mar 8.90 10.48 NaN 10.02 - 12.96 10.49 10.92 20.87 12.84 9.05 NaN NaN NaN NaN 8.44 9.1 NaN NaN 10.16
2000Feb 8.93 10.14 NaN 9.96 - 12.95 10.35 10.91 21.22 12.53 8.97 NaN NaN NaN NaN 7.94 9.1 NaN NaN 10.09
2000Jan 8.83 10.01 NaN 9.81 - 12.96 10.28 10.91 21.62 12.53 8.88 NaN NaN NaN NaN 7.44 9.0 NaN NaN 9.98

In [16]:
eu.index


Out[16]:
Index([u'2016Feb', u'2016Jan', u'2015Dec', u'2015Nov', u'2015Oct', u'2015Sep',
       u'2015Aug', u'2015Jul', u'2015Jun', u'2015May',
       ...
       u'2000Oct', u'2000Sep', u'2000Aug', u'2000Jul', u'2000Jun', u'2000May',
       u'2000Apr', u'2000Mar', u'2000Feb', u'2000Jan'],
      dtype='object', length=194)

In [17]:
eu.columns


Out[17]:
MultiIndex(levels=[[u'Austria', u'Belgium', u'Cyprus', u'Estonia', u'Euro area (changing composition)', u'Finland', u'France', u'Germany', u'Greece (GR)', u'Ireland', u'Italy', u'Latvia', u'Lithuania', u'Luxembourg', u'Malta', u'Netherlands', u'Portugal', u'Slovakia', u'Slovenia', u'Spain'], [u'Average of observations through period (A)', u'End of period (E)'], [u'[Percent per annum ]']],
           labels=[[0, 1, 2, 7, 3, 19, 5, 6, 8, 9, 10, 12, 13, 11, 14, 15, 16, 18, 17, 4], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
           names=[None, u'Collection:', u'Period\Unit:'])

In [12]:
eu.shape


Out[12]:
(194, 20)

In [13]:
eu.min(axis=1)


Out[13]:
2016Feb    4.20
2016Jan    4.17
2015Dec    3.99
2015Nov    4.09
2015Oct    4.10
2015Sep    4.32
2015Aug    4.28
2015Jul    4.07
2015Jun    4.29
2015May    4.32
2015Apr    4.21
2015Mar    4.43
2015Feb    4.26
2015Jan    4.24
2014Dec    3.92
2014Nov    3.86
2014Oct    3.85
2014Sep    3.95
2014Aug    3.95
2014Jul    4.01
2014Jun    3.71
2014May    3.64
2014Apr    3.70
2014Mar    3.67
2014Feb    3.66
2014Jan    3.66
2013Dec    3.69
2013Nov    3.64
2013Oct    3.55
2013Sep    3.57
           ... 
2002Jun    7.94
2002May    7.94
2002Apr    7.90
2002Mar    7.94
2002Feb    7.94
2002Jan    7.94
2001Dec    7.94
2001Nov    7.94
2001Oct    8.65
2001Sep    8.69
2001Aug    8.81
2001Jul    8.79
2001Jun    8.74
2001May    8.83
2001Apr    8.83
2001Mar    8.84
2001Feb    8.84
2001Jan    8.87
2000Dec    8.83
2000Nov    9.05
2000Oct    9.12
2000Sep    9.07
2000Aug    9.06
2000Jul    9.00
2000Jun    9.12
2000May    8.93
2000Apr    8.44
2000Mar    8.44
2000Feb    7.94
2000Jan    7.44
dtype: float64

In [19]:
eu.min()


Out[19]:
                                  Collection:                                 Period\Unit:        
Austria                           End of period (E)                           [Percent per annum ]    3.99
Belgium                           End of period (E)                           [Percent per annum ]    7.67
Cyprus                            End of period (E)                           [Percent per annum ]    6.13
Germany                           End of period (E)                           [Percent per annum ]    8.69
Estonia                           End of period (E)                           [Percent per annum ]       -
Spain                             End of period (E)                           [Percent per annum ]    8.07
Finland                           End of period (E)                           [Percent per annum ]     6.4
France                            End of period (E)                           [Percent per annum ]    5.86
Greece (GR)                       End of period (E)                           [Percent per annum ]    8.18
Ireland                           End of period (E)                           [Percent per annum ]    7.34
Italy                             End of period (E)                           [Percent per annum ]    5.91
Lithuania                         End of period (E)                           [Percent per annum ]    3.48
Luxembourg                        End of period (E)                           [Percent per annum ]     3.1
Latvia                            End of period (E)                           [Percent per annum ]    4.45
Malta                             End of period (E)                           [Percent per annum ]     inf
Netherlands                       End of period (E)                           [Percent per annum ]    5.62
Portugal                          End of period (E)                           [Percent per annum ]     7.9
Slovenia                          End of period (E)                           [Percent per annum ]     inf
Slovakia                          End of period (E)                           [Percent per annum ]     inf
Euro area (changing composition)  Average of observations through period (A)  [Percent per annum ]    7.23
dtype: object

In [20]:
eu * 3


Out[20]:
Austria Belgium Cyprus Germany Estonia Spain Finland France Greece (GR) Ireland Italy Lithuania Luxembourg Latvia Malta Netherlands Portugal Slovenia Slovakia Euro area (changing composition)
Collection: End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) End of period (E) Average of observations through period (A)
Period\Unit: [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ] [Percent per annum ]
2016Feb 12.60 24.27 18.39 26.55 16.3816.3816.38 33.09 19.23 18.00 24.54 31.20 18.21 28.80 21.72 64.74 6.796.796.79 17.49 45.84 6.806.806.80 13.8613.8613.86 22.08
2016Jan 12.51 24.15 18.39 26.49 16.4116.4116.41 32.55 19.32 18.30 24.57 29.73 18.21 28.74 21.30 64.53 6.826.826.82 17.43 46.23 6.796.796.79 13.9713.9713.97 22.05
2015Dec 11.97 24.63 18.48 26.07 16.3216.3216.32 31.47 19.20 17.58 24.66 31.11 17.73 28.35 20.88 64.77 6.846.846.84 17.64 45.48 6.656.656.65 13.7213.7213.72 21.69
2015Nov 12.27 24.60 18.45 26.46 16.3716.3716.37 32.19 19.47 18.54 24.90 27.33 18.36 28.59 20.64 65.01 6.786.786.78 17.91 45.96 6.796.796.79 14.1014.1014.10 22.11
2015Oct 12.30 25.20 18.48 26.67 16.4216.4216.42 32.58 19.56 18.45 25.02 27.87 18.33 28.20 21.24 65.22 6.786.786.78 17.79 46.65 6.746.746.74 14.1214.1214.12 22.23
2015Sep 12.96 25.74 18.51 26.85 16.4416.4416.44 32.61 19.56 19.23 25.59 28.14 18.42 27.99 21.21 65.25 6.796.796.79 17.91 46.53 6.816.816.81 14.2114.2114.21 22.59
2015Aug 12.84 24.81 19.08 26.73 16.4016.4016.40 32.43 19.41 19.17 25.77 26.73 18.36 28.17 21.39 65.40 6.606.606.60 18.15 45.63 6.796.796.79 14.2614.2614.26 22.47
2015Jul 12.21 24.69 19.14 26.70 16.3716.3716.37 32.22 19.32 18.75 25.35 26.49 18.57 28.29 21.78 65.46 6.786.786.78 17.76 46.26 6.716.716.71 14.2114.2114.21 22.32
2015Jun 12.87 24.51 19.26 27.03 16.3616.3616.36 32.49 19.41 19.71 25.95 25.62 18.81 28.50 21.99 65.76 6.786.786.78 17.61 46.41 6.766.766.76 14.1514.1514.15 22.74
2015May 12.96 24.36 19.38 26.97 16.3316.3316.33 33.21 19.47 20.16 25.71 25.17 18.84 28.83 21.96 65.43 6.766.766.76 17.70 47.43 6.806.806.80 14.1414.1414.14 22.86
2015Apr 12.63 24.72 19.20 27.30 16.3116.3116.31 33.27 20.01 19.74 25.71 24.96 19.08 28.92 21.99 65.58 6.786.786.78 17.97 47.19 6.826.826.82 13.9713.9713.97 22.92
2015Mar 13.29 24.93 18.69 27.63 16.3216.3216.32 33.63 19.71 20.67 25.71 25.23 19.11 27.96 22.77 64.68 6.776.776.77 18.15 46.98 6.866.866.86 13.8913.8913.89 23.25
2015Feb 12.78 24.27 21.42 27.66 16.3216.3216.32 34.32 20.07 20.67 25.86 25.05 19.71 27.93 25.35 64.65 6.756.756.75 17.91 47.40 6.906.906.90 13.9613.9613.96 23.40
2015Jan 12.72 24.93 21.54 27.66 16.3216.3216.32 33.39 20.01 20.61 25.74 22.50 19.71 27.81 24.66 64.83 6.766.766.76 18.12 47.49 6.906.906.90 14.0014.0014.00 23.28
2014Dec 12.60 25.11 21.60 27.60 16.2616.2616.26 32.76 19.89 19.95 25.74 23.13 19.20 11.76 26.04 64.35 6.776.776.77 18.03 46.53 6.876.876.87 13.7513.7513.75 22.92
2014Nov 12.90 24.96 21.57 27.60 16.3516.3516.35 33.03 19.86 21.30 25.98 22.77 19.95 11.58 22.17 63.33 6.736.736.73 18.24 47.70 7.017.017.01 13.4013.4013.40 23.40
2014Oct 12.90 25.20 21.60 27.81 16.3616.3616.36 31.89 19.80 20.88 27.12 22.02 20.10 11.55 22.02 63.36 6.716.716.71 18.21 47.94 6.956.956.95 13.5713.5713.57 23.31
2014Sep 13.77 23.16 21.60 28.20 16.3916.3916.39 32.37 20.04 21.66 27.03 22.47 20.49 11.85 21.18 64.11 6.696.696.69 18.18 47.34 6.976.976.97 13.5913.5913.59 23.70
2014Aug 13.50 23.04 21.72 27.81 16.3016.3016.30 32.40 20.10 21.48 25.80 22.50 20.40 11.85 21.30 64.08 6.726.726.72 17.88 46.59 6.966.966.96 13.5813.5813.58 23.43
2014Jul 13.56 23.01 21.84 28.11 16.3016.3016.30 31.74 20.01 20.70 26.19 22.47 20.58 12.03 21.12 64.14 6.626.626.62 18.00 46.98 6.886.886.88 13.4513.4513.45 23.31
2014Jun 13.86 24.12 21.96 28.38 16.3616.3616.36 32.25 20.19 21.48 26.58 22.47 21.09 11.13 21.39 64.17 6.696.696.69 17.97 47.22 7.037.037.03 13.5513.5513.55 23.76
2014May 13.62 24.18 21.87 28.05 16.2916.2916.29 32.28 20.49 21.66 26.91 22.29 21.03 10.92 21.06 64.29 6.726.726.72 18.18 47.70 7.007.007.00 13.6113.6113.61 23.76
2014Apr 13.77 26.10 21.93 27.75 16.3816.3816.38 32.28 20.49 22.08 27.09 22.44 21.18 11.10 21.75 64.05 6.726.726.72 18.36 47.16 7.067.067.06 13.6913.6913.69 23.88
2014Mar 14.37 26.22 21.93 28.38 16.3916.3916.39 32.19 20.55 22.53 27.00 22.41 21.36 11.01 21.60 63.90 6.796.796.79 18.30 47.67 7.077.077.07 13.6613.6613.66 24.18
2014Feb 13.74 26.52 21.93 28.23 16.5116.5116.51 32.49 20.49 23.04 27.18 22.59 21.60 10.98 22.41 64.14 6.806.806.80 18.21 48.12 7.167.167.16 13.6413.6413.64 24.33
2014Jan 13.71 26.85 21.99 28.35 16.5216.5216.52 31.50 20.37 22.44 27.27 22.71 21.54 10.98 21.36 64.98 6.826.826.82 18.33 47.88 7.127.127.12 13.7213.7213.72 24.12
2013Dec 13.50 26.91 21.69 28.26 16.4716.4716.47 30.12 20.28 21.99 27.36 22.83 20.91 11.07 22.68 25.68 6.866.866.86 18.24 46.62 7.207.207.20 13.6513.6513.65 23.76
2013Nov 13.32 26.82 21.96 28.32 16.5316.5316.53 31.83 20.28 22.71 27.21 22.68 21.24 10.92 21.30 25.86 6.836.836.83 18.51 47.37 7.307.307.30 13.7213.7213.72 24.06
2013Oct 13.86 27.03 23.40 28.59 16.5316.5316.53 31.86 20.19 22.23 27.93 22.38 21.57 10.65 21.63 26.34 6.886.886.88 18.69 48.09 7.257.257.25 13.8113.8113.81 24.24
2013Sep 14.55 26.94 23.43 28.83 16.5416.5416.54 30.96 20.28 22.92 27.78 22.74 21.57 10.71 21.00 28.35 6.876.876.87 18.51 48.03 7.287.287.28 13.8813.8813.88 24.39
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2002Jun 25.50 33.66 NaN 32.88 --- 39.48 30.27 36.15 47.73 39.18 27.72 NaN NaN NaN NaN 23.82 25.20 NaN NaN 32.40
2002May 25.50 33.66 NaN 32.76 --- 39.45 30.39 36.09 47.82 39.18 27.57 NaN NaN NaN NaN 23.82 25.20 NaN NaN 32.28
2002Apr 25.50 33.66 NaN 32.76 --- 39.51 30.45 36.09 47.79 39.18 27.60 NaN NaN NaN NaN 23.82 23.70 NaN NaN 32.22
2002Mar 25.59 33.66 NaN 32.46 --- 39.30 30.00 35.55 47.64 39.18 27.63 NaN NaN NaN NaN 23.82 24.30 NaN NaN 31.98
2002Feb 25.62 33.66 NaN 32.61 --- 39.45 29.94 35.55 47.70 39.18 27.72 NaN NaN NaN NaN 23.82 25.50 NaN NaN 32.07
2002Jan 25.50 33.66 NaN 32.67 --- 39.15 30.33 35.55 47.64 39.18 27.72 NaN NaN NaN NaN 23.82 25.80 NaN NaN 32.07
2001Dec 25.68 33.66 NaN 32.70 --- 39.81 30.45 35.34 46.17 39.18 27.84 NaN NaN NaN NaN 23.82 27.60 NaN NaN 32.19
2001Nov 25.83 33.78 NaN 32.88 --- 39.60 30.75 35.31 46.38 39.18 28.53 NaN NaN NaN NaN 23.82 30.00 NaN NaN 32.43
2001Oct 25.95 34.74 NaN 33.12 --- 39.75 31.44 35.31 46.71 40.53 29.16 NaN NaN NaN NaN 26.79 31.20 NaN NaN 32.91
2001Sep 26.07 35.31 NaN 33.21 --- 39.66 31.83 36.09 47.49 41.73 29.55 NaN NaN NaN NaN 26.79 29.70 NaN NaN 33.12
2001Aug 26.43 37.41 NaN 33.57 --- 39.72 33.15 36.09 47.25 42.72 29.67 NaN NaN NaN NaN 31.26 30.60 NaN NaN 33.69
2001Jul 26.37 37.86 NaN 33.51 --- 39.57 33.36 36.09 47.19 42.72 29.79 NaN NaN NaN NaN 31.26 31.80 NaN NaN 33.75
2001Jun 26.22 37.86 NaN 33.72 --- 39.45 33.45 36.84 47.28 42.72 29.88 NaN NaN NaN NaN 31.26 30.30 NaN NaN 33.90
2001May 26.49 37.86 NaN 33.36 --- 39.51 33.84 36.87 48.24 42.72 30.09 NaN NaN NaN NaN 31.26 32.40 NaN NaN 33.87
2001Apr 26.49 37.86 NaN 33.72 --- 39.45 34.05 36.87 49.32 43.23 30.15 NaN NaN NaN NaN 32.76 32.10 NaN NaN 34.11
2001Mar 26.52 37.80 NaN 33.66 --- 39.39 34.29 36.27 49.56 43.23 30.18 NaN NaN NaN NaN 32.76 32.40 NaN NaN 33.99
2001Feb 26.52 37.86 NaN 33.75 --- 39.39 34.20 36.27 51.27 43.23 30.27 NaN NaN NaN NaN 32.76 33.00 NaN NaN 34.08
2001Jan 26.61 37.86 NaN 33.99 --- 39.54 34.47 36.27 51.57 43.23 30.39 NaN NaN NaN NaN 32.76 32.10 NaN NaN 34.17
2000Dec 26.49 37.89 NaN 33.63 --- 38.79 34.17 35.43 53.40 43.23 30.48 NaN NaN NaN NaN 32.76 32.40 NaN NaN 33.93
2000Nov 27.15 37.89 NaN 33.81 --- 38.79 34.44 35.43 54.00 43.14 30.69 NaN NaN NaN NaN 32.76 30.30 NaN NaN 33.96
2000Oct 27.36 36.81 NaN 33.51 --- 38.61 34.47 35.43 54.63 43.02 30.60 NaN NaN NaN NaN 32.76 30.30 NaN NaN 33.75
2000Sep 27.21 36.81 NaN 32.76 --- 38.67 34.05 35.07 55.17 42.00 29.94 NaN NaN NaN NaN 31.26 28.80 NaN NaN 33.12
2000Aug 27.18 36.81 NaN 32.64 --- 39.03 33.96 35.10 55.77 41.79 29.28 NaN NaN NaN NaN 29.76 29.40 NaN NaN 32.91
2000Jul 27.00 34.71 NaN 32.58 --- 39.03 33.27 35.10 55.98 41.79 29.34 NaN NaN NaN NaN 29.76 30.90 NaN NaN 32.85
2000Jun 27.36 34.65 NaN 31.50 --- 38.85 33.09 33.12 57.75 40.71 28.80 NaN NaN NaN NaN 29.76 28.50 NaN NaN 32.04
2000May 27.18 34.65 NaN 30.75 --- 39.06 32.49 33.09 58.05 39.24 28.08 NaN NaN NaN NaN 26.79 28.20 NaN NaN 31.32
2000Apr 26.97 32.46 NaN 30.63 --- 39.03 31.62 33.09 61.38 39.24 27.54 NaN NaN NaN NaN 25.32 27.60 NaN NaN 30.99
2000Mar 26.70 31.44 NaN 30.06 --- 38.88 31.47 32.76 62.61 38.52 27.15 NaN NaN NaN NaN 25.32 27.30 NaN NaN 30.48
2000Feb 26.79 30.42 NaN 29.88 --- 38.85 31.05 32.73 63.66 37.59 26.91 NaN NaN NaN NaN 23.82 27.30 NaN NaN 30.27
2000Jan 26.49 30.03 NaN 29.43 --- 38.88 30.84 32.73 64.86 37.59 26.64 NaN NaN NaN NaN 22.32 27.00 NaN NaN 29.94

194 rows × 20 columns


In [21]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [24]:
eu.plot(legend=False)


Out[24]:
<matplotlib.axes._subplots.AxesSubplot at 0x10edd7710>

Data types: dtypes

DataFrame is built on Numpy -- and uses the same data type representations.


In [25]:
eu.dtypes


Out[25]:
                                  Collection:                                 Period\Unit:        
Austria                           End of period (E)                           [Percent per annum ]    float64
Belgium                           End of period (E)                           [Percent per annum ]    float64
Cyprus                            End of period (E)                           [Percent per annum ]    float64
Germany                           End of period (E)                           [Percent per annum ]    float64
Estonia                           End of period (E)                           [Percent per annum ]     object
Spain                             End of period (E)                           [Percent per annum ]    float64
Finland                           End of period (E)                           [Percent per annum ]    float64
France                            End of period (E)                           [Percent per annum ]    float64
Greece (GR)                       End of period (E)                           [Percent per annum ]    float64
Ireland                           End of period (E)                           [Percent per annum ]    float64
Italy                             End of period (E)                           [Percent per annum ]    float64
Lithuania                         End of period (E)                           [Percent per annum ]    float64
Luxembourg                        End of period (E)                           [Percent per annum ]    float64
Latvia                            End of period (E)                           [Percent per annum ]    float64
Malta                             End of period (E)                           [Percent per annum ]     object
Netherlands                       End of period (E)                           [Percent per annum ]    float64
Portugal                          End of period (E)                           [Percent per annum ]    float64
Slovenia                          End of period (E)                           [Percent per annum ]     object
Slovakia                          End of period (E)                           [Percent per annum ]     object
Euro area (changing composition)  Average of observations through period (A)  [Percent per annum ]    float64
dtype: object

converting types

If you try to "cast" the value for Slovenia, you will get an error

eu['Slovenia'].astype('float')

This is due to an empty "n/a" value.

missing values

Let's re-read the dataset setting expected "na" values:


In [28]:
eu = pd.read_csv('data/eu_revolving_loans.csv',
                 header=[1,2,3],
                 index_col=0,
                 skiprows=1,
                 na_values=['-'])

In [29]:
eu.dtypes


Out[29]:
                                  Collection:                                 Period\Unit:        
Austria                           End of period (E)                           [Percent per annum ]    float64
Belgium                           End of period (E)                           [Percent per annum ]    float64
Cyprus                            End of period (E)                           [Percent per annum ]    float64
Germany                           End of period (E)                           [Percent per annum ]    float64
Estonia                           End of period (E)                           [Percent per annum ]    float64
Spain                             End of period (E)                           [Percent per annum ]    float64
Finland                           End of period (E)                           [Percent per annum ]    float64
France                            End of period (E)                           [Percent per annum ]    float64
Greece (GR)                       End of period (E)                           [Percent per annum ]    float64
Ireland                           End of period (E)                           [Percent per annum ]    float64
Italy                             End of period (E)                           [Percent per annum ]    float64
Lithuania                         End of period (E)                           [Percent per annum ]    float64
Luxembourg                        End of period (E)                           [Percent per annum ]    float64
Latvia                            End of period (E)                           [Percent per annum ]    float64
Malta                             End of period (E)                           [Percent per annum ]    float64
Netherlands                       End of period (E)                           [Percent per annum ]    float64
Portugal                          End of period (E)                           [Percent per annum ]    float64
Slovenia                          End of period (E)                           [Percent per annum ]    float64
Slovakia                          End of period (E)                           [Percent per annum ]    float64
Euro area (changing composition)  Average of observations through period (A)  [Percent per annum ]    float64
dtype: object

Filtering with Pandas


In [30]:
trade = pd.read_csv('data/ext_lt_intratrd.tsv', sep='\t')

In [31]:
trade.dtypes


Out[31]:
indic_et,sitc06,partner,geo\time    object
2015                                object
2014                                object
2013                                object
2012                                object
2011                                object
2010                                object
2009                                object
2008                                object
2007                                object
2006                                object
2005                                object
2004                                object
2003                                object
2002                                object
2001                                object
2000                                object
1999                                object
dtype: object

In [32]:
trade.columns


Out[32]:
Index([u'indic_et,sitc06,partner,geo\time', u'2015 ', u'2014 ', u'2013 ',
       u'2012 ', u'2011 ', u'2010 ', u'2009 ', u'2008 ', u'2007 ', u'2006 ',
       u'2005 ', u'2004 ', u'2003 ', u'2002 ', u'2001 ', u'2000 ', u'1999 '],
      dtype='object')

In [33]:
# expect an key error below due to extra spaces in names

trade['2013']


---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-33-fc1740f3cbe6> in <module>()
----> 1 trade['2013']

/Users/pmui/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/core/frame.pyc in __getitem__(self, key)
   1990             return self._getitem_multilevel(key)
   1991         else:
-> 1992             return self._getitem_column(key)
   1993 
   1994     def _getitem_column(self, key):

/Users/pmui/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/core/frame.pyc in _getitem_column(self, key)
   1997         # get column
   1998         if self.columns.is_unique:
-> 1999             return self._get_item_cache(key)
   2000 
   2001         # duplicate columns & possible reduce dimensionality

/Users/pmui/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/core/generic.pyc in _get_item_cache(self, item)
   1343         res = cache.get(item)
   1344         if res is None:
-> 1345             values = self._data.get(item)
   1346             res = self._box_item_values(item, values)
   1347             cache[item] = res

/Users/pmui/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/core/internals.pyc in get(self, item, fastpath)
   3223 
   3224             if not isnull(item):
-> 3225                 loc = self.items.get_loc(item)
   3226             else:
   3227                 indexer = np.arange(len(self.items))[isnull(self.items)]

/Users/pmui/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/indexes/base.pyc in get_loc(self, key, method, tolerance)
   1876                 return self._engine.get_loc(key)
   1877             except KeyError:
-> 1878                 return self._engine.get_loc(self._maybe_cast_indexer(key))
   1879 
   1880         indexer = self.get_indexer([key], method=method, tolerance=tolerance)

pandas/index.pyx in pandas.index.IndexEngine.get_loc (pandas/index.c:4027)()

pandas/index.pyx in pandas.index.IndexEngine.get_loc (pandas/index.c:3891)()

pandas/hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12408)()

pandas/hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12359)()

KeyError: '2013'

In [34]:
new_cols = dict([(col, col.strip()) for col in trade.columns])

In [35]:
new_cols


Out[35]:
{'1999 ': '1999',
 '2000 ': '2000',
 '2001 ': '2001',
 '2002 ': '2002',
 '2003 ': '2003',
 '2004 ': '2004',
 '2005 ': '2005',
 '2006 ': '2006',
 '2007 ': '2007',
 '2008 ': '2008',
 '2009 ': '2009',
 '2010 ': '2010',
 '2011 ': '2011',
 '2012 ': '2012',
 '2013 ': '2013',
 '2014 ': '2014',
 '2015 ': '2015',
 'indic_et,sitc06,partner,geo\\time': 'indic_et,sitc06,partner,geo\\time'}

In [38]:
trade.rename(columns=new_cols)


Out[38]:
indic_et,sitc06,partner,geo\time 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002 2001 2000 1999
0 CONT_EXP_EU,SITC0_1,EU27,AT 2.4 2.5 2.4 2.5 2.5 2.5 2.6 2.6 2.6 2.6 2.5 2.4 2.4 2.1 2.1 2.0 1.9
1 CONT_EXP_EU,SITC0_1,EU27,BE 9.1 9.0 9.0 9.2 9.1 9.1 9.6 9.4 9.5 9.6 9.9 10.1 10.2 10.4 10.5 10.4 10.6
2 CONT_EXP_EU,SITC0_1,EU27,BG 0.6 0.6 0.6 0.6 0.6 0.6 0.5 0.4 0.3 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.2
3 CONT_EXP_EU,SITC0_1,EU27,CY 0.1 0.1 0.1 0.0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1
4 CONT_EXP_EU,SITC0_1,EU27,CZ 1.9 1.7 1.6 1.6 1.5 1.4 1.4 1.4 1.3 1.1 1.1 0.9 0.7 0.7 0.6 0.6 0.5
5 CONT_EXP_EU,SITC0_1,EU27,DE 16.0 16.3 16.3 16.0 16.0 16.0 16.4 16.3 16.2 15.7 15.5 14.7 14.4 14.1 14.2 13.7 13.1
6 CONT_EXP_EU,SITC0_1,EU27,DK 3.4 3.6 3.6 3.7 3.8 4.1 4.1 4.1 4.3 4.8 4.6 4.7 4.8 5.1 5.3 5.2 5.1
7 CONT_EXP_EU,SITC0_1,EU27,EE 0.2 0.3 0.3 0.3 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.1 0.1 0.1 0.1
8 CONT_EXP_EU,SITC0_1,EU27,EL 1.1 1.1 1.0 1.1 1.1 1.2 1.2 1.1 1.1 1.1 1.1 1.1 0.9 0.9 1.2 1.2 1.2
9 CONT_EXP_EU,SITC0_1,EU27,ES 9.3 8.8 8.8 8.7 8.6 8.7 8.6 8.4 8.3 8.6 8.8 9.2 9.7 9.3 9.2 8.6 7.7
10 CONT_EXP_EU,SITC0_1,EU27,EU27 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0
11 CONT_EXP_EU,SITC0_1,EU27,FI 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
12 CONT_EXP_EU,SITC0_1,EU27,FR 10.9 11.6 12.1 12.3 12.6 12.2 12.8 13.5 13.9 14.1 14.4 15.3 15.9 15.9 15.7 16.9 17.9
13 CONT_EXP_EU,SITC0_1,EU27,HU 1.7 1.7 1.8 1.9 1.9 1.6 1.5 1.6 1.5 1.2 1.1 1.1 1.1 1.0 1.1 1.0 1.0
14 CONT_EXP_EU,SITC0_1,EU27,IE 2.6 2.5 2.5 2.5 2.6 2.6 2.6 2.7 3.1 3.2 3.1 3.2 3.2 3.2 3.2 3.4 3.4
15 CONT_EXP_EU,SITC0_1,EU27,IT 7.0 6.9 6.8 6.9 7.0 7.2 7.1 7.1 7.1 7.0 7.1 7.2 7.1 7.3 7.3 7.1 7.5
16 CONT_EXP_EU,SITC0_1,EU27,LT 0.8 0.8 0.7 0.7 0.7 0.6 0.6 0.6 0.6 0.5 0.4 0.3 0.2 0.2 0.2 0.2 0.1
17 CONT_EXP_EU,SITC0_1,EU27,LU 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.4 0.4 0.4 0.4 0.4 0.4 0.4
18 CONT_EXP_EU,SITC0_1,EU27,LV 0.3 0.3 0.4 0.4 0.3 0.3 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.1 0.1 0.0 0.0
19 CONT_EXP_EU,SITC0_1,EU27,MT 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
20 CONT_EXP_EU,SITC0_1,EU27,NL 16.3 16.7 16.9 16.7 17.1 17.4 17.2 17.3 17.1 17.3 17.7 18.1 18.2 18.7 18.7 18.7 18.8
21 CONT_EXP_EU,SITC0_1,EU27,PL 5.7 5.4 5.0 4.7 4.2 4.1 3.8 3.7 3.4 3.1 2.7 2.1 1.5 1.3 1.3 1.2 1.1
22 CONT_EXP_EU,SITC0_1,EU27,PT 1.3 1.2 1.2 1.1 1.2 1.2 1.2 1.2 1.1 1.1 1.0 0.9 0.9 0.9 0.9 0.9 0.8
23 CONT_EXP_EU,SITC0_1,EU27,RO 0.9 0.9 0.8 0.8 0.8 0.7 0.6 0.4 0.3 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1
24 CONT_EXP_EU,SITC0_1,EU27,SE 1.8 1.8 1.7 1.6 1.6 1.6 1.5 1.4 1.4 1.4 1.3 1.2 1.1 1.0 0.9 0.9 0.9
25 CONT_EXP_EU,SITC0_1,EU27,SI 0.3 0.3 0.3 0.4 0.3 0.3 0.3 0.3 0.3 0.2 0.1 0.1 0.1 0.1 0.0 0.1 0.1
26 CONT_EXP_EU,SITC0_1,EU27,SK 0.7 0.7 0.8 0.9 0.8 0.7 0.7 0.6 0.7 0.6 0.5 0.4 0.3 0.3 0.2 0.2 0.2
27 CONT_EXP_EU,SITC0_1,EU27,UK 4.8 4.7 4.6 4.8 4.9 5.0 4.8 4.9 5.1 5.2 5.3 5.7 5.9 6.0 5.9 6.7 7.0
28 CONT_EXP_EU,SITC0_1,EU28,AT 2.4 2.5 2.5 2.5 2.5 2.6 2.6 2.7 2.6 2.6 2.5 2.5 2.4 2.2 : : :
29 CONT_EXP_EU,SITC0_1,EU28,BE 9.0 8.9 8.9 9.2 9.1 9.1 9.6 9.4 9.4 9.6 9.9 10.1 10.2 10.4 : : :
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
9298 PC_TOT_IMP,TOTAL,EXT_EU27,UK 46.4 47.0 48.2 52.4 51.8 51.0 50.5 48.7 46.3 43.8 44.0 44.0 43.3 42.7 46.4 48.2 45.2
9299 PC_TOT_IMP,TOTAL,EXT_EU28,AT 23.3 23.2 23.4 23.5 22.6 22.0 21.6 21.3 20.1 19.7 18.9 16.4 17.6 18.7 19.0 19.4 17.4
9300 PC_TOT_IMP,TOTAL,EXT_EU28,BE 37.1 35.0 33.6 32.4 32.3 30.9 29.6 30.1 29.4 28.5 27.9 27.1 26.4 27.1 28.0 29.1 27.7
9301 PC_TOT_IMP,TOTAL,EXT_EU28,BG 35.6 38.3 40.3 41.2 40.5 41.3 39.8 43.0 41.2 38.6 37.0 42.6 42.0 42.2 42.9 47.0 45.1
9302 PC_TOT_IMP,TOTAL,EXT_EU28,CY 26.4 28.6 29.5 30.8 30.8 29.5 27.5 32.0 30.9 31.2 30.6 30.4 39.6 42.4 41.0 41.4 41.1
9303 PC_TOT_IMP,TOTAL,EXT_EU28,CZ 22.8 22.6 23.2 24.6 25.3 25.0 21.9 23.0 19.8 19.4 18.5 19.6 28.5 27.3 25.3 24.7 23.3
9304 PC_TOT_IMP,TOTAL,EXT_EU28,DE 34.3 34.5 35.3 36.4 36.5 36.7 35.3 36.3 35.3 36.2 35.4 34.2 33.8 34.2 35.3 36.7 33.8
9305 PC_TOT_IMP,TOTAL,EXT_EU28,DK 30.7 30.6 30.0 29.2 29.5 30.1 30.1 28.3 27.1 27.7 29.0 29.1 26.6 25.2 27.3 27.8 26.5
9306 PC_TOT_IMP,TOTAL,EXT_EU28,EE 18.2 18.3 17.9 22.2 23.6 20.2 19.6 20.2 21.4 25.5 23.7 26.2 35.0 31.1 33.6 29.4 26.8
9307 PC_TOT_IMP,TOTAL,EXT_EU28,EL 47.3 51.5 52.7 54.0 48.4 47.3 42.2 44.2 41.8 40.9 39.1 37.1 41.6 44.2 36.7 35.0 29.9
9308 PC_TOT_IMP,TOTAL,EXT_EU28,ES 39.4 42.7 44.7 45.8 43.1 41.0 37.6 40.7 37.0 38.2 35.8 32.0 30.7 30.8 31.3 32.3 30.0
9309 PC_TOT_IMP,TOTAL,EXT_EU28,EU28 36.7 37.2 37.9 39.3 38.5 38.1 36.5 37.3 35.7 36.0 35.4 33.8 33.8 34.1 : : :
9310 PC_TOT_IMP,TOTAL,EXT_EU28,FI 27.1 31.9 33.7 37.2 38.5 35.8 34.9 37.9 35.9 36.0 33.3 32.6 31.7 30.1 30.6 33.1 30.8
9311 PC_TOT_IMP,TOTAL,EXT_EU28,FR 31.7 32.3 32.2 32.9 32.6 31.5 30.5 31.8 30.5 30.8 32.4 30.3 29.7 31.4 32.4 32.7 31.3
9312 PC_TOT_IMP,TOTAL,EXT_EU28,HR 22.3 23.8 33.1 37.5 38.2 39.8 37.3 35.9 35.2 32.8 31.9 28.4 26.8 28.1 : : :
9313 PC_TOT_IMP,TOTAL,EXT_EU28,HU 23.8 24.8 28.3 29.3 30.2 32.0 31.1 31.4 30.2 29.5 29.8 31.2 35.3 34.8 33.9 33.7 28.1
9314 PC_TOT_IMP,TOTAL,EXT_EU28,IE 33.5 33.5 32.7 33.1 30.5 32.6 34.5 30.1 30.0 31.5 33.3 34.1 37.2 32.9 33.0 36.6 37.1
9315 PC_TOT_IMP,TOTAL,EXT_EU28,IT 41.5 42.9 44.6 46.7 45.9 44.8 42.1 45.0 41.9 42.0 40.1 37.2 36.3 36.8 37.7 38.7 34.0
9316 PC_TOT_IMP,TOTAL,EXT_EU28,LT 33.0 34.4 39.7 42.4 43.2 43.4 40.9 42.4 31.6 37.2 40.5 36.5 43.9 43.1 45.2 45.1 39.7
9317 PC_TOT_IMP,TOTAL,EXT_EU28,LU 27.9 20.0 20.8 22.8 18.4 19.8 28.6 25.3 26.3 29.4 27.6 24.0 22.5 16.7 18.6 16.1 17.6
9318 PC_TOT_IMP,TOTAL,EXT_EU28,LV 20.3 19.5 20.0 21.8 22.3 23.9 24.5 24.4 22.5 23.4 24.6 24.2 24.4 22.4 23.9 25.7 24.2
9319 PC_TOT_IMP,TOTAL,EXT_EU28,MT 34.7 37.3 29.0 22.9 26.2 29.8 25.0 23.6 26.0 29.3 24.1 26.7 31.8 31.8 35.3 39.4 33.9
9320 PC_TOT_IMP,TOTAL,EXT_EU28,NL 54.4 54.2 53.7 54.6 53.3 53.1 50.9 51.9 50.8 51.3 50.5 46.8 45.1 44.8 46.1 46.7 42.7
9321 PC_TOT_IMP,TOTAL,EXT_EU28,PL 29.6 30.4 31.0 32.3 30.0 29.2 27.3 28.1 26.6 26.9 24.6 24.6 30.3 30.2 30.3 31.0 27.7
9322 PC_TOT_IMP,TOTAL,EXT_EU28,PT 23.5 25.2 28.0 28.5 26.7 23.6 21.4 25.2 23.4 23.0 22.4 22.9 20.5 20.1 23.3 23.5 21.1
9323 PC_TOT_IMP,TOTAL,EXT_EU28,RO 22.9 24.6 24.2 26.4 27.2 27.4 26.8 30.2 28.6 36.5 36.8 33.8 31.7 31.8 32.9 34.7 30.9
9324 PC_TOT_IMP,TOTAL,EXT_EU28,SE 30.1 31.2 31.1 32.7 31.8 32.9 32.0 30.8 28.9 30.3 29.5 27.7 28.0 28.9 30.0 31.6 28.7
9325 PC_TOT_IMP,TOTAL,EXT_EU28,SI 30.1 30.9 29.9 28.0 27.8 27.5 24.7 24.6 21.6 17.7 16.0 13.5 19.9 18.9 18.7 18.7 18.2
9326 PC_TOT_IMP,TOTAL,EXT_EU28,SK 21.3 23.9 25.7 26.3 26.7 27.9 25.0 26.8 25.2 24.6 22.0 21.0 25.5 26.8 27.9 29.7 25.3
9327 PC_TOT_IMP,TOTAL,EXT_EU28,UK 46.4 47.0 48.2 52.4 51.7 51.0 50.5 48.6 46.3 43.7 44.0 43.9 43.3 42.7 46.4 48.1 45.2

9328 rows × 18 columns


In [37]:
trade = trade.rename(columns=new_cols)

In [39]:
trade['2013']


Out[39]:
0         2.4 
1         9.0 
2         0.6 
3         0.1 
4         1.6 
5        16.3 
6         3.6 
7         0.3 
8         1.0 
9         8.8 
10      100.0 
11        0.3 
12       12.1 
13        1.8 
14        2.5 
15        6.8 
16        0.7 
17        0.3 
18        0.4 
19        0.0 
20       16.9 
21        5.0 
22        1.2 
23        0.8 
24        1.7 
25        0.3 
26        0.8 
27        4.6 
28        2.5 
29        8.9 
         ...  
9298     48.2 
9299     23.4 
9300     33.6 
9301     40.3 
9302     29.5 
9303     23.2 
9304     35.3 
9305     30.0 
9306     17.9 
9307     52.7 
9308     44.7 
9309     37.9 
9310     33.7 
9311     32.2 
9312     33.1 
9313     28.3 
9314     32.7 
9315     44.6 
9316     39.7 
9317     20.8 
9318     20.0 
9319     29.0 
9320     53.7 
9321     31.0 
9322     28.0 
9323     24.2 
9324     31.1 
9325     29.9 
9326     25.7 
9327     48.2 
Name: 2013, dtype: object

In [42]:
# selecting row 3

trade.ix[3]


Out[42]:
indic_et,sitc06,partner,geo\time    CONT_EXP_EU,SITC0_1,EU27,CY
2015                                                       0.1 
2014                                                       0.1 
2013                                                       0.1 
2012                                                       0.0 
2011                                                       0.1 
2010                                                       0.1 
2009                                                       0.1 
2008                                                       0.1 
2007                                                       0.1 
2006                                                       0.1 
2005                                                       0.1 
2004                                                       0.1 
2003                                                       0.1 
2002                                                       0.1 
2001                                                       0.1 
2000                                                       0.1 
1999                                                       0.1 
Name: 3, dtype: object

In [41]:
# selecting all rows where column index = 0

trade.ix[:,0]


Out[41]:
0          CONT_EXP_EU,SITC0_1,EU27,AT
1          CONT_EXP_EU,SITC0_1,EU27,BE
2          CONT_EXP_EU,SITC0_1,EU27,BG
3          CONT_EXP_EU,SITC0_1,EU27,CY
4          CONT_EXP_EU,SITC0_1,EU27,CZ
5          CONT_EXP_EU,SITC0_1,EU27,DE
6          CONT_EXP_EU,SITC0_1,EU27,DK
7          CONT_EXP_EU,SITC0_1,EU27,EE
8          CONT_EXP_EU,SITC0_1,EU27,EL
9          CONT_EXP_EU,SITC0_1,EU27,ES
10       CONT_EXP_EU,SITC0_1,EU27,EU27
11         CONT_EXP_EU,SITC0_1,EU27,FI
12         CONT_EXP_EU,SITC0_1,EU27,FR
13         CONT_EXP_EU,SITC0_1,EU27,HU
14         CONT_EXP_EU,SITC0_1,EU27,IE
15         CONT_EXP_EU,SITC0_1,EU27,IT
16         CONT_EXP_EU,SITC0_1,EU27,LT
17         CONT_EXP_EU,SITC0_1,EU27,LU
18         CONT_EXP_EU,SITC0_1,EU27,LV
19         CONT_EXP_EU,SITC0_1,EU27,MT
20         CONT_EXP_EU,SITC0_1,EU27,NL
21         CONT_EXP_EU,SITC0_1,EU27,PL
22         CONT_EXP_EU,SITC0_1,EU27,PT
23         CONT_EXP_EU,SITC0_1,EU27,RO
24         CONT_EXP_EU,SITC0_1,EU27,SE
25         CONT_EXP_EU,SITC0_1,EU27,SI
26         CONT_EXP_EU,SITC0_1,EU27,SK
27         CONT_EXP_EU,SITC0_1,EU27,UK
28         CONT_EXP_EU,SITC0_1,EU28,AT
29         CONT_EXP_EU,SITC0_1,EU28,BE
                     ...              
9298      PC_TOT_IMP,TOTAL,EXT_EU27,UK
9299      PC_TOT_IMP,TOTAL,EXT_EU28,AT
9300      PC_TOT_IMP,TOTAL,EXT_EU28,BE
9301      PC_TOT_IMP,TOTAL,EXT_EU28,BG
9302      PC_TOT_IMP,TOTAL,EXT_EU28,CY
9303      PC_TOT_IMP,TOTAL,EXT_EU28,CZ
9304      PC_TOT_IMP,TOTAL,EXT_EU28,DE
9305      PC_TOT_IMP,TOTAL,EXT_EU28,DK
9306      PC_TOT_IMP,TOTAL,EXT_EU28,EE
9307      PC_TOT_IMP,TOTAL,EXT_EU28,EL
9308      PC_TOT_IMP,TOTAL,EXT_EU28,ES
9309    PC_TOT_IMP,TOTAL,EXT_EU28,EU28
9310      PC_TOT_IMP,TOTAL,EXT_EU28,FI
9311      PC_TOT_IMP,TOTAL,EXT_EU28,FR
9312      PC_TOT_IMP,TOTAL,EXT_EU28,HR
9313      PC_TOT_IMP,TOTAL,EXT_EU28,HU
9314      PC_TOT_IMP,TOTAL,EXT_EU28,IE
9315      PC_TOT_IMP,TOTAL,EXT_EU28,IT
9316      PC_TOT_IMP,TOTAL,EXT_EU28,LT
9317      PC_TOT_IMP,TOTAL,EXT_EU28,LU
9318      PC_TOT_IMP,TOTAL,EXT_EU28,LV
9319      PC_TOT_IMP,TOTAL,EXT_EU28,MT
9320      PC_TOT_IMP,TOTAL,EXT_EU28,NL
9321      PC_TOT_IMP,TOTAL,EXT_EU28,PL
9322      PC_TOT_IMP,TOTAL,EXT_EU28,PT
9323      PC_TOT_IMP,TOTAL,EXT_EU28,RO
9324      PC_TOT_IMP,TOTAL,EXT_EU28,SE
9325      PC_TOT_IMP,TOTAL,EXT_EU28,SI
9326      PC_TOT_IMP,TOTAL,EXT_EU28,SK
9327      PC_TOT_IMP,TOTAL,EXT_EU28,UK
Name: indic_et,sitc06,partner,geo\time, dtype: object

In [43]:
# split out the column with index 0 & assign to new column 'geo'
# representing the country 2 letter code

trade['geo'] = trade.ix[:,0].map(lambda row: row.split(',')[-1])

In [44]:
trade['geo'].head()


Out[44]:
0    AT
1    BE
2    BG
3    CY
4    CZ
Name: geo, dtype: object

In [45]:
trade['geo'].isin(['UK', 'DE'])


Out[45]:
0       False
1       False
2       False
3       False
4       False
5        True
6       False
7       False
8       False
9       False
10      False
11      False
12      False
13      False
14      False
15      False
16      False
17      False
18      False
19      False
20      False
21      False
22      False
23      False
24      False
25      False
26      False
27       True
28      False
29      False
        ...  
9298     True
9299    False
9300    False
9301    False
9302    False
9303    False
9304     True
9305    False
9306    False
9307    False
9308    False
9309    False
9310    False
9311    False
9312    False
9313    False
9314    False
9315    False
9316    False
9317    False
9318    False
9319    False
9320    False
9321    False
9322    False
9323    False
9324    False
9325    False
9326    False
9327     True
Name: geo, dtype: bool

In [46]:
trade[trade['geo'].isin(['UK', 'DE'])]


Out[46]:
indic_et,sitc06,partner,geo\time 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002 2001 2000 1999 geo
5 CONT_EXP_EU,SITC0_1,EU27,DE 16.0 16.3 16.3 16.0 16.0 16.0 16.4 16.3 16.2 15.7 15.5 14.7 14.4 14.1 14.2 13.7 13.1 DE
27 CONT_EXP_EU,SITC0_1,EU27,UK 4.8 4.7 4.6 4.8 4.9 5.0 4.8 4.9 5.1 5.2 5.3 5.7 5.9 6.0 5.9 6.7 7.0 UK
33 CONT_EXP_EU,SITC0_1,EU28,DE 16.0 16.3 16.2 16.0 16.0 16.0 16.4 16.2 16.1 15.6 15.5 14.7 14.4 14.1 : : : DE
56 CONT_EXP_EU,SITC0_1,EU28,UK 4.8 4.7 4.5 4.7 4.9 5.0 4.8 4.8 5.1 5.2 5.3 5.7 5.9 6.0 : : : UK
62 CONT_EXP_EU,SITC0_1,EXT_EU27,DE 12.8 12.5 12.6 13.1 13.2 13.2 13.6 12.8 11.8 11.6 10.7 9.9 10.2 10.2 10.7 10.9 10.6 DE
84 CONT_EXP_EU,SITC0_1,EXT_EU27,UK 8.9 8.6 8.3 8.7 8.7 8.4 8.3 7.9 8.8 9.5 10.4 11.0 11.6 11.9 12.3 12.9 13.3 UK
90 CONT_EXP_EU,SITC0_1,EXT_EU28,DE 12.6 12.4 12.4 12.9 13.0 13.0 13.4 12.7 11.6 11.4 10.5 9.7 10.0 10.1 : : : DE
113 CONT_EXP_EU,SITC0_1,EXT_EU28,UK 9.0 8.6 8.4 8.8 8.7 8.5 8.4 7.9 8.9 9.6 10.5 11.1 11.6 12.0 : : : UK
119 CONT_EXP_EU,SITC2_4,EU27,DE 16.5 16.3 15.8 16.5 16.8 16.6 15.7 16.8 17.3 16.2 15.6 14.4 14.1 14.5 14.2 13.9 13.7 DE
141 CONT_EXP_EU,SITC2_4,EU27,UK 3.6 3.8 3.9 4.5 4.3 4.3 3.9 4.4 4.6 4.7 4.5 4.7 5.0 5.0 4.8 4.9 4.7 UK
147 CONT_EXP_EU,SITC2_4,EU28,DE 16.3 16.2 15.7 16.4 16.7 16.5 15.6 16.7 17.2 16.1 15.5 14.3 14.0 14.5 : : : DE
170 CONT_EXP_EU,SITC2_4,EU28,UK 3.6 3.8 3.9 4.4 4.3 4.2 3.8 4.4 4.6 4.7 4.4 4.7 4.9 5.0 : : : UK
176 CONT_EXP_EU,SITC2_4,EXT_EU27,DE 12.6 13.3 13.5 13.8 14.2 14.7 15.1 16.3 15.8 15.2 14.2 12.6 12.4 13.5 13.3 13.3 13.6 DE
198 CONT_EXP_EU,SITC2_4,EXT_EU27,UK 10.5 10.6 10.3 11.7 12.5 12.1 11.2 13.0 12.6 11.8 11.8 12.0 11.2 9.8 9.4 9.3 9.4 UK
204 CONT_EXP_EU,SITC2_4,EXT_EU28,DE 12.5 13.3 13.5 13.8 14.2 14.7 15.0 16.2 15.8 15.2 14.2 12.6 12.4 13.5 : : : DE
227 CONT_EXP_EU,SITC2_4,EXT_EU28,UK 10.5 10.6 10.3 11.7 12.4 12.1 11.3 13.0 12.6 11.9 11.8 12.1 11.2 9.9 : : : UK
233 CONT_EXP_EU,SITC3,EU27,DE 13.1 10.1 9.3 8.8 9.7 9.2 10.0 9.9 11.4 11.3 10.4 12.6 10.3 9.0 6.5 6.3 8.4 DE
255 CONT_EXP_EU,SITC3,EU27,UK 12.5 14.7 14.5 15.1 16.0 16.8 15.7 15.1 16.2 16.9 15.7 19.1 19.7 22.3 24.0 23.1 22.6 UK
261 CONT_EXP_EU,SITC3,EU28,DE 12.9 10.0 9.2 8.8 9.6 9.1 9.9 9.9 11.3 11.2 10.3 12.5 10.3 9.0 : : : DE
284 CONT_EXP_EU,SITC3,EU28,UK 12.3 14.5 14.4 14.9 15.8 16.7 15.5 15.0 16.1 16.8 15.6 18.9 19.6 22.2 : : : UK
290 CONT_EXP_EU,SITC3,EXT_EU27,DE 7.7 6.7 6.7 7.4 5.4 5.6 7.2 7.3 8.5 9.3 8.6 8.7 8.9 9.6 6.7 7.1 8.3 DE
312 CONT_EXP_EU,SITC3,EXT_EU27,UK 9.0 8.4 9.8 10.7 11.4 13.2 14.4 14.2 13.9 15.7 20.3 23.3 24.8 27.7 27.8 30.6 27.7 UK
318 CONT_EXP_EU,SITC3,EXT_EU28,DE 7.7 6.7 6.8 7.4 5.4 5.6 7.2 7.3 8.5 9.3 8.6 8.7 8.9 9.5 : : : DE
341 CONT_EXP_EU,SITC3,EXT_EU28,UK 9.1 8.5 9.8 10.8 11.5 13.2 14.4 14.3 13.9 15.7 20.2 23.3 24.8 27.7 : : : UK
347 CONT_EXP_EU,SITC5,EU27,DE 22.4 22.4 22.3 22.1 22.5 23.0 22.5 22.5 22.5 21.9 21.3 20.8 20.1 18.4 20.4 20.3 20.5 DE
369 CONT_EXP_EU,SITC5,EU27,UK 7.2 7.3 7.2 7.9 7.6 7.9 8.2 8.1 8.6 9.1 9.2 9.7 9.9 10.2 10.9 10.9 11.3 UK
375 CONT_EXP_EU,SITC5,EU28,DE 22.4 22.3 22.2 22.1 22.5 22.9 22.5 22.5 22.5 21.9 21.2 20.8 20.1 18.4 : : : DE
398 CONT_EXP_EU,SITC5,EU28,UK 7.1 7.2 7.2 7.9 7.6 7.9 8.1 8.1 8.5 9.1 9.1 9.7 9.8 10.2 : : : UK
404 CONT_EXP_EU,SITC5,EXT_EU27,DE 25.4 26.2 25.7 24.8 24.1 24.0 24.4 24.7 23.1 23.1 21.9 23.1 21.9 22.2 25.2 25.2 26.6 DE
426 CONT_EXP_EU,SITC5,EXT_EU27,UK 11.5 9.1 9.2 10.3 10.5 11.5 11.8 10.9 11.6 12.0 11.4 12.2 13.3 13.0 13.7 13.9 14.9 UK
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
8905 PC_TOT_IMP,SITC6_8,EU28,DE 64.2 65.6 65.5 64.6 64.0 63.5 63.4 64.9 64.9 65.5 66.1 65.5 66.0 65.8 64.1 63.9 65.4 DE
8928 PC_TOT_IMP,SITC6_8,EU28,UK 48.2 48.9 47.1 47.2 47.0 46.0 47.1 47.4 47.5 47.1 48.0 50.4 51.1 49.7 47.3 46.9 50.1 UK
8934 PC_TOT_IMP,SITC6_8,EXT_EU27,DE 36.0 34.7 34.7 35.5 36.2 36.7 36.8 35.3 35.3 34.7 34.1 34.7 34.2 34.5 36.2 36.4 35.0 DE
8956 PC_TOT_IMP,SITC6_8,EXT_EU27,UK 51.8 51.1 52.9 52.8 53.0 54.1 52.9 52.6 52.6 52.9 52.0 49.7 48.9 50.4 52.7 53.2 50.0 UK
8962 PC_TOT_IMP,SITC6_8,EXT_EU28,DE 35.8 34.4 34.5 35.4 36.0 36.5 36.6 35.1 35.1 34.5 33.9 34.5 34.0 34.2 35.9 36.1 34.6 DE
8985 PC_TOT_IMP,SITC6_8,EXT_EU28,UK 51.8 51.1 52.9 52.8 53.0 54.0 52.9 52.6 52.5 52.9 52.0 49.6 48.9 50.3 52.7 53.1 49.9 UK
8991 PC_TOT_IMP,SITC7,EU27,DE 66.8 68.1 67.3 65.8 65.2 62.8 66.9 65.5 65.1 63.8 63.6 64.3 66.1 66.2 64.4 61.0 64.1 DE
9013 PC_TOT_IMP,SITC7,EU27,UK 58.5 59.0 57.9 57.5 57.4 55.4 57.5 60.8 62.2 62.6 61.9 61.1 60.3 58.5 55.3 53.8 56.4 UK
9019 PC_TOT_IMP,SITC7,EU28,DE 66.9 68.2 67.4 65.9 65.3 62.8 67.0 65.6 65.2 64.0 63.7 64.4 66.1 66.3 64.5 61.1 64.2 DE
9042 PC_TOT_IMP,SITC7,EU28,UK 58.5 59.1 58.0 57.5 57.5 55.5 57.6 60.8 62.2 62.6 61.9 61.1 60.3 58.5 55.3 53.8 56.4 UK
9048 PC_TOT_IMP,SITC7,EXT_EU27,DE 33.2 31.9 32.7 34.2 34.8 37.2 33.1 34.5 34.9 36.2 36.4 35.7 33.9 33.8 35.6 39.0 35.9 DE
9070 PC_TOT_IMP,SITC7,EXT_EU27,UK 41.5 41.0 42.1 42.5 42.6 44.6 42.5 39.2 37.8 37.4 38.1 38.9 39.7 41.5 44.7 46.2 43.6 UK
9076 PC_TOT_IMP,SITC7,EXT_EU28,DE 33.1 31.8 32.6 34.1 34.7 37.2 33.0 34.4 34.8 36.0 36.3 35.6 33.9 33.7 35.5 38.9 35.8 DE
9099 PC_TOT_IMP,SITC7,EXT_EU28,UK 41.5 40.9 42.0 42.5 42.5 44.5 42.4 39.2 37.8 37.4 38.1 38.9 39.7 41.5 44.7 46.2 43.6 UK
9105 PC_TOT_IMP,SITC9,EU27,DE 48.1 47.2 44.0 51.7 51.0 54.9 52.6 62.9 62.6 60.5 56.0 81.4 79.1 71.8 78.7 83.3 86.8 DE
9127 PC_TOT_IMP,SITC9,EU27,UK 5.1 4.9 11.1 6.3 7.9 6.6 5.0 20.3 29.0 71.0 73.3 46.9 45.3 70.0 54.4 29.6 4.9 UK
9133 PC_TOT_IMP,SITC9,EU28,DE 48.1 47.2 44.1 51.9 51.1 55.1 52.8 63.0 62.7 60.7 56.2 81.5 79.2 71.8 78.7 83.4 86.9 DE
9156 PC_TOT_IMP,SITC9,EU28,UK 5.1 4.9 11.1 6.3 7.9 6.6 5.0 20.3 29.0 71.0 73.3 46.9 45.3 70.0 54.4 29.6 4.9 UK
9162 PC_TOT_IMP,SITC9,EXT_EU27,DE 51.9 52.8 56.0 48.3 49.0 45.1 47.4 37.1 37.4 39.5 44.0 18.6 20.9 28.2 21.3 16.7 13.2 DE
9184 PC_TOT_IMP,SITC9,EXT_EU27,UK 94.9 95.1 88.9 93.7 92.1 93.4 95.0 79.7 71.0 29.0 26.7 53.1 54.7 30.0 45.6 70.4 95.1 UK
9190 PC_TOT_IMP,SITC9,EXT_EU28,DE 51.9 52.8 55.9 48.1 48.9 44.9 47.2 37.0 37.3 39.3 43.8 18.5 20.8 28.2 21.3 16.6 13.1 DE
9213 PC_TOT_IMP,SITC9,EXT_EU28,UK 94.9 95.1 88.9 93.7 92.1 93.4 95.0 79.7 71.0 29.0 26.7 53.1 54.7 30.0 45.6 70.4 95.1 UK
9219 PC_TOT_IMP,TOTAL,EU27,DE 65.6 65.4 64.6 63.5 63.4 63.2 64.6 63.6 64.6 63.7 64.5 65.7 66.1 65.7 64.6 63.2 66.0 DE
9241 PC_TOT_IMP,TOTAL,EU27,UK 53.6 53.0 51.8 47.6 48.2 49.0 49.5 51.3 53.7 56.2 56.0 56.0 56.7 57.3 53.6 51.8 54.8 UK
9247 PC_TOT_IMP,TOTAL,EU28,DE 65.7 65.5 64.7 63.6 63.5 63.3 64.7 63.7 64.7 63.8 64.6 65.8 66.2 65.8 64.7 63.3 66.2 DE
9270 PC_TOT_IMP,TOTAL,EU28,UK 53.6 53.0 51.8 47.6 48.3 49.0 49.5 51.4 53.7 56.3 56.0 56.1 56.7 57.3 53.6 51.9 54.8 UK
9276 PC_TOT_IMP,TOTAL,EXT_EU27,DE 34.4 34.6 35.4 36.5 36.6 36.8 35.4 36.4 35.4 36.3 35.5 34.3 33.9 34.3 35.4 36.8 34.0 DE
9298 PC_TOT_IMP,TOTAL,EXT_EU27,UK 46.4 47.0 48.2 52.4 51.8 51.0 50.5 48.7 46.3 43.8 44.0 44.0 43.3 42.7 46.4 48.2 45.2 UK
9304 PC_TOT_IMP,TOTAL,EXT_EU28,DE 34.3 34.5 35.3 36.4 36.5 36.7 35.3 36.3 35.3 36.2 35.4 34.2 33.8 34.2 35.3 36.7 33.8 DE
9327 PC_TOT_IMP,TOTAL,EXT_EU28,UK 46.4 47.0 48.2 52.4 51.7 51.0 50.5 48.6 46.3 43.7 44.0 43.9 43.3 42.7 46.4 48.1 45.2 UK

656 rows × 19 columns


In [48]:
# boolean selecting with more complex boolean expressions
# - find all countries where there are continuous growth from 2012-2014
trade[(trade['2014'] > trade['2013']) & 
      (trade['2013'] > trade['2012'])]


Out[48]:
indic_et,sitc06,partner,geo\time 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002 2001 2000 1999 geo
21 CONT_EXP_EU,SITC0_1,EU27,PL 5.7 5.4 5.0 4.7 4.2 4.1 3.8 3.7 3.4 3.1 2.7 2.1 1.5 1.3 1.3 1.2 1.1 PL
24 CONT_EXP_EU,SITC0_1,EU27,SE 1.8 1.8 1.7 1.6 1.6 1.6 1.5 1.4 1.4 1.4 1.3 1.2 1.1 1.0 0.9 0.9 0.9 SE
33 CONT_EXP_EU,SITC0_1,EU28,DE 16.0 16.3 16.2 16.0 16.0 16.0 16.4 16.2 16.1 15.6 15.5 14.7 14.4 14.1 : : : DE
50 CONT_EXP_EU,SITC0_1,EU28,PL 5.7 5.4 5.0 4.7 4.2 4.1 3.8 3.7 3.4 3.2 2.7 2.1 1.5 1.3 : : : PL
53 CONT_EXP_EU,SITC0_1,EU28,SE 1.8 1.8 1.7 1.6 1.6 1.6 1.5 1.4 1.4 1.4 1.3 1.2 1.1 1.0 : : : SE
71 CONT_EXP_EU,SITC0_1,EXT_EU27,IE 2.6 2.6 2.4 2.3 2.1 2.0 1.9 2.2 3.0 3.2 3.0 3.0 3.0 3.0 3.6 4.0 4.0 IE
72 CONT_EXP_EU,SITC0_1,EXT_EU27,IT 10.0 9.5 9.3 9.2 9.3 9.5 10.1 10.0 9.9 9.8 9.9 10.1 10.1 10.0 9.5 8.8 8.8 IT
77 CONT_EXP_EU,SITC0_1,EXT_EU27,NL 13.2 13.6 13.0 12.8 13.0 13.7 14.0 13.0 13.7 13.3 13.1 13.5 13.7 13.8 12.9 12.8 12.4 NL
100 CONT_EXP_EU,SITC0_1,EXT_EU28,IE 2.6 2.6 2.4 2.3 2.1 2.0 1.9 2.2 3.0 3.2 3.1 3.0 3.1 3.1 : : : IE
101 CONT_EXP_EU,SITC0_1,EXT_EU28,IT 9.9 9.4 9.2 9.1 9.1 9.4 9.9 9.8 9.8 9.6 9.7 9.9 9.9 9.8 : : : IT
106 CONT_EXP_EU,SITC0_1,EXT_EU28,NL 13.2 13.6 13.0 12.7 13.0 13.7 14.0 13.0 13.7 13.3 13.1 13.5 13.6 13.8 : : : NL
123 CONT_EXP_EU,SITC2_4,EU27,ES 5.9 6.4 6.0 5.6 5.5 5.2 5.4 5.0 4.7 4.7 5.0 5.4 5.4 6.0 5.5 5.3 4.2 ES
125 CONT_EXP_EU,SITC2_4,EU27,FI 2.2 2.2 2.0 1.7 1.8 2.0 1.7 2.0 2.6 2.9 2.9 3.2 3.9 3.8 3.9 4.5 4.4 FI
135 CONT_EXP_EU,SITC2_4,EU27,PL 3.6 3.5 3.2 2.7 2.6 2.8 2.5 2.6 2.5 2.4 2.1 2.2 1.9 1.7 1.6 1.6 1.5 PL
151 CONT_EXP_EU,SITC2_4,EU28,ES 5.9 6.3 5.9 5.5 5.5 5.1 5.4 5.0 4.7 4.6 5.0 5.3 5.3 5.9 : : : ES
153 CONT_EXP_EU,SITC2_4,EU28,FI 2.2 2.2 2.0 1.7 1.8 2.0 1.7 2.0 2.6 2.9 2.9 3.2 3.8 3.8 : : : FI
164 CONT_EXP_EU,SITC2_4,EU28,PL 3.6 3.4 3.2 2.7 2.6 2.8 2.5 2.6 2.5 2.4 2.1 2.1 1.9 1.7 : : : PL
171 CONT_EXP_EU,SITC2_4,EXT_EU27,AT 2.5 2.2 2.1 2.0 2.2 2.2 2.5 2.5 2.5 2.2 2.7 3.0 3.2 3.4 3.4 3.2 3.6 AT
185 CONT_EXP_EU,SITC2_4,EXT_EU27,IE 1.0 1.1 1.0 0.9 0.9 0.8 0.8 0.8 1.2 1.7 1.7 1.7 1.7 1.8 1.9 1.7 1.8 IE
186 CONT_EXP_EU,SITC2_4,EXT_EU27,IT 7.1 6.8 6.6 6.3 6.5 7.0 7.5 7.2 7.4 8.0 7.9 7.9 8.1 8.6 9.1 9.2 8.6 IT
187 CONT_EXP_EU,SITC2_4,EXT_EU27,LT 0.9 0.9 0.7 0.5 0.6 0.4 0.4 0.6 0.5 0.5 0.6 0.6 0.5 0.6 0.5 0.4 0.3 LT
192 CONT_EXP_EU,SITC2_4,EXT_EU27,PL 2.1 2.3 2.1 1.7 1.4 1.3 1.1 1.3 0.9 0.9 1.1 1.1 0.9 0.9 1.0 0.8 1.1 PL
193 CONT_EXP_EU,SITC2_4,EXT_EU27,PT 1.8 1.8 1.7 1.5 1.5 1.4 1.6 1.5 1.3 1.3 1.2 1.0 1.0 1.1 1.3 1.5 1.5 PT
196 CONT_EXP_EU,SITC2_4,EXT_EU27,SI 1.2 1.1 1.0 0.9 0.7 0.8 1.0 0.9 0.9 0.8 0.6 0.4 0.3 0.3 0.3 0.2 0.3 SI
199 CONT_EXP_EU,SITC2_4,EXT_EU28,AT 2.4 2.1 2.0 1.9 2.1 2.1 2.3 2.4 2.4 2.1 2.6 2.9 3.1 3.2 : : : AT
214 CONT_EXP_EU,SITC2_4,EXT_EU28,IE 1.0 1.1 1.0 0.9 0.9 0.8 0.8 0.8 1.2 1.7 1.8 1.8 1.8 1.8 : : : IE
215 CONT_EXP_EU,SITC2_4,EXT_EU28,IT 6.9 6.7 6.5 6.2 6.4 7.0 7.4 7.0 7.1 7.7 7.5 7.5 7.8 8.3 : : : IT
216 CONT_EXP_EU,SITC2_4,EXT_EU28,LT 0.9 0.9 0.7 0.5 0.6 0.4 0.4 0.6 0.5 0.5 0.6 0.6 0.5 0.6 : : : LT
221 CONT_EXP_EU,SITC2_4,EXT_EU28,PL 2.1 2.3 2.1 1.7 1.4 1.3 1.1 1.3 0.9 0.9 1.1 1.1 0.9 0.9 : : : PL
222 CONT_EXP_EU,SITC2_4,EXT_EU28,PT 1.8 1.8 1.7 1.5 1.5 1.4 1.6 1.5 1.3 1.3 1.2 1.0 1.0 1.1 : : : PT
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
9236 PC_TOT_IMP,TOTAL,EU27,PT 76.4 74.7 72.0 71.5 73.3 76.4 78.6 74.8 76.6 77.0 77.6 77.1 79.5 79.9 76.7 76.4 78.9 PT
9240 PC_TOT_IMP,TOTAL,EU27,SK 78.4 75.8 74.2 73.6 73.2 72.0 74.9 73.1 74.6 75.2 77.8 78.9 74.4 73.0 72.0 70.2 74.5 SK
9241 PC_TOT_IMP,TOTAL,EU27,UK 53.6 53.0 51.8 47.6 48.2 49.0 49.5 51.3 53.7 56.2 56.0 56.0 56.7 57.3 53.6 51.8 54.8 UK
9242 PC_TOT_IMP,TOTAL,EU28,AT 76.7 76.8 76.6 76.5 77.4 78.0 78.4 78.7 79.9 80.3 81.1 83.6 82.4 81.3 81.0 80.6 82.6 AT
9244 PC_TOT_IMP,TOTAL,EU28,BG 64.4 61.7 59.7 58.8 59.5 58.7 60.2 57.0 58.8 61.4 63.0 57.4 58.0 57.8 57.1 53.0 54.9 BG
9245 PC_TOT_IMP,TOTAL,EU28,CY 73.6 71.4 70.5 69.2 69.2 70.5 72.5 68.0 69.1 68.8 69.4 69.6 60.4 57.6 59.0 58.6 58.9 CY
9246 PC_TOT_IMP,TOTAL,EU28,CZ 77.2 77.4 76.8 75.4 74.7 75.0 78.1 77.0 80.2 80.6 81.5 80.4 71.5 72.7 74.7 75.3 76.7 CZ
9247 PC_TOT_IMP,TOTAL,EU28,DE 65.7 65.5 64.7 63.6 63.5 63.3 64.7 63.7 64.7 63.8 64.6 65.8 66.2 65.8 64.7 63.3 66.2 DE
9250 PC_TOT_IMP,TOTAL,EU28,EL 52.7 48.5 47.3 46.0 51.6 52.7 57.8 55.8 58.2 59.1 60.9 62.9 58.4 55.8 63.3 65.0 70.1 EL
9251 PC_TOT_IMP,TOTAL,EU28,ES 60.6 57.3 55.3 54.2 56.9 59.0 62.4 59.3 63.0 61.8 64.2 68.0 69.3 69.2 68.7 67.7 70.0 ES
9252 PC_TOT_IMP,TOTAL,EU28,EU28 63.3 62.8 62.1 60.7 61.5 61.9 63.5 62.7 64.3 64.0 64.6 66.2 66.2 65.9 : : : EU28
9253 PC_TOT_IMP,TOTAL,EU28,FI 72.9 68.1 66.3 62.8 61.5 64.2 65.1 62.1 64.1 64.0 66.7 67.4 68.3 69.9 69.4 66.9 69.2 FI
9255 PC_TOT_IMP,TOTAL,EU28,HR 77.7 76.2 66.9 62.5 61.8 60.2 62.7 64.1 64.8 67.2 68.1 71.6 73.2 71.9 : : : HR
9256 PC_TOT_IMP,TOTAL,EU28,HU 76.2 75.2 71.7 70.7 69.8 68.0 68.9 68.6 69.8 70.5 70.2 68.8 64.7 65.2 66.1 66.3 71.9 HU
9258 PC_TOT_IMP,TOTAL,EU28,IT 58.5 57.1 55.4 53.3 54.1 55.2 57.9 55.0 58.1 58.0 59.9 62.8 63.7 63.2 62.3 61.3 66.0 IT
9259 PC_TOT_IMP,TOTAL,EU28,LT 67.0 65.6 60.3 57.6 56.8 56.6 59.1 57.6 68.4 62.8 59.5 63.5 56.1 56.9 54.8 54.9 60.3 LT
9260 PC_TOT_IMP,TOTAL,EU28,LU 72.1 80.0 79.2 77.2 81.6 80.2 71.4 74.7 73.7 70.6 72.4 76.0 77.5 83.3 81.4 83.9 82.4 LU
9261 PC_TOT_IMP,TOTAL,EU28,LV 79.7 80.5 80.0 78.2 77.7 76.1 75.5 75.6 77.5 76.6 75.4 75.8 75.6 77.6 76.1 74.3 75.8 LV
9264 PC_TOT_IMP,TOTAL,EU28,PL 70.4 69.6 69.0 67.7 70.0 70.8 72.7 71.9 73.4 73.1 75.4 75.4 69.7 69.8 69.7 69.0 72.3 PL
9265 PC_TOT_IMP,TOTAL,EU28,PT 76.5 74.8 72.0 71.5 73.3 76.4 78.6 74.8 76.6 77.0 77.6 77.1 79.5 79.9 76.7 76.5 78.9 PT
9269 PC_TOT_IMP,TOTAL,EU28,SK 78.7 76.1 74.3 73.7 73.3 72.1 75.0 73.2 74.8 75.4 78.0 79.0 74.5 73.2 72.1 70.3 74.7 SK
9270 PC_TOT_IMP,TOTAL,EU28,UK 53.6 53.0 51.8 47.6 48.3 49.0 49.5 51.4 53.7 56.3 56.0 56.1 56.7 57.3 53.6 51.9 54.8 UK
9272 PC_TOT_IMP,TOTAL,EXT_EU27,BE 37.2 35.0 33.6 32.5 32.3 30.9 29.7 30.1 29.4 28.5 27.9 27.2 26.4 27.1 28.0 29.2 27.7 BE
9277 PC_TOT_IMP,TOTAL,EXT_EU27,DK 30.7 30.6 30.0 29.3 29.5 30.1 30.1 28.4 27.2 27.8 29.0 29.1 26.6 25.2 27.3 27.8 26.5 DK
9290 PC_TOT_IMP,TOTAL,EXT_EU27,MT 35.8 38.8 29.9 23.3 26.4 29.8 25.1 23.6 26.0 29.3 24.2 26.8 31.8 31.8 35.3 39.4 33.9 MT
9296 PC_TOT_IMP,TOTAL,EXT_EU27,SI 35.3 35.1 34.7 32.8 32.3 32.1 29.0 28.7 26.3 22.3 20.2 17.3 23.5 22.5 22.7 23.1 22.6 SI
9300 PC_TOT_IMP,TOTAL,EXT_EU28,BE 37.1 35.0 33.6 32.4 32.3 30.9 29.6 30.1 29.4 28.5 27.9 27.1 26.4 27.1 28.0 29.1 27.7 BE
9305 PC_TOT_IMP,TOTAL,EXT_EU28,DK 30.7 30.6 30.0 29.2 29.5 30.1 30.1 28.3 27.1 27.7 29.0 29.1 26.6 25.2 27.3 27.8 26.5 DK
9319 PC_TOT_IMP,TOTAL,EXT_EU28,MT 34.7 37.3 29.0 22.9 26.2 29.8 25.0 23.6 26.0 29.3 24.1 26.7 31.8 31.8 35.3 39.4 33.9 MT
9325 PC_TOT_IMP,TOTAL,EXT_EU28,SI 30.1 30.9 29.9 28.0 27.8 27.5 24.7 24.6 21.6 17.7 16.0 13.5 19.9 18.9 18.7 18.7 18.2 SI

2041 rows × 19 columns


In [49]:
# create a column that represents those with increase from 2012 - 2013

trade['2013inc'] = trade['2013'] > trade['2012']

In [50]:
trade['2013inc'].head()


Out[50]:
0    False
1    False
2    False
3     True
4    False
Name: 2013inc, dtype: bool

Creating a new index not on the values but on the 2 letter geo-code column


In [51]:
trade = trade.set_index('geo')

In [52]:
# now filter based on the geo column

trade.loc['DE']


Out[52]:
indic_et,sitc06,partner,geo\time 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002 2001 2000 1999 2013inc
geo
DE CONT_EXP_EU,SITC0_1,EU27,DE 16.0 16.3 16.3 16.0 16.0 16.0 16.4 16.3 16.2 15.7 15.5 14.7 14.4 14.1 14.2 13.7 13.1 True
DE CONT_EXP_EU,SITC0_1,EU28,DE 16.0 16.3 16.2 16.0 16.0 16.0 16.4 16.2 16.1 15.6 15.5 14.7 14.4 14.1 : : : True
DE CONT_EXP_EU,SITC0_1,EXT_EU27,DE 12.8 12.5 12.6 13.1 13.2 13.2 13.6 12.8 11.8 11.6 10.7 9.9 10.2 10.2 10.7 10.9 10.6 False
DE CONT_EXP_EU,SITC0_1,EXT_EU28,DE 12.6 12.4 12.4 12.9 13.0 13.0 13.4 12.7 11.6 11.4 10.5 9.7 10.0 10.1 : : : False
DE CONT_EXP_EU,SITC2_4,EU27,DE 16.5 16.3 15.8 16.5 16.8 16.6 15.7 16.8 17.3 16.2 15.6 14.4 14.1 14.5 14.2 13.9 13.7 False
DE CONT_EXP_EU,SITC2_4,EU28,DE 16.3 16.2 15.7 16.4 16.7 16.5 15.6 16.7 17.2 16.1 15.5 14.3 14.0 14.5 : : : False
DE CONT_EXP_EU,SITC2_4,EXT_EU27,DE 12.6 13.3 13.5 13.8 14.2 14.7 15.1 16.3 15.8 15.2 14.2 12.6 12.4 13.5 13.3 13.3 13.6 False
DE CONT_EXP_EU,SITC2_4,EXT_EU28,DE 12.5 13.3 13.5 13.8 14.2 14.7 15.0 16.2 15.8 15.2 14.2 12.6 12.4 13.5 : : : False
DE CONT_EXP_EU,SITC3,EU27,DE 13.1 10.1 9.3 8.8 9.7 9.2 10.0 9.9 11.4 11.3 10.4 12.6 10.3 9.0 6.5 6.3 8.4 True
DE CONT_EXP_EU,SITC3,EU28,DE 12.9 10.0 9.2 8.8 9.6 9.1 9.9 9.9 11.3 11.2 10.3 12.5 10.3 9.0 : : : True
DE CONT_EXP_EU,SITC3,EXT_EU27,DE 7.7 6.7 6.7 7.4 5.4 5.6 7.2 7.3 8.5 9.3 8.6 8.7 8.9 9.6 6.7 7.1 8.3 False
DE CONT_EXP_EU,SITC3,EXT_EU28,DE 7.7 6.7 6.8 7.4 5.4 5.6 7.2 7.3 8.5 9.3 8.6 8.7 8.9 9.5 : : : False
DE CONT_EXP_EU,SITC5,EU27,DE 22.4 22.4 22.3 22.1 22.5 23.0 22.5 22.5 22.5 21.9 21.3 20.8 20.1 18.4 20.4 20.3 20.5 True
DE CONT_EXP_EU,SITC5,EU28,DE 22.4 22.3 22.2 22.1 22.5 22.9 22.5 22.5 22.5 21.9 21.2 20.8 20.1 18.4 : : : True
DE CONT_EXP_EU,SITC5,EXT_EU27,DE 25.4 26.2 25.7 24.8 24.1 24.0 24.4 24.7 23.1 23.1 21.9 23.1 21.9 22.2 25.2 25.2 26.6 True
DE CONT_EXP_EU,SITC5,EXT_EU28,DE 25.4 26.2 25.7 24.8 24.1 23.9 24.4 24.7 23.1 23.1 21.8 23.1 21.9 22.2 : : : True
DE CONT_EXP_EU,SITC6_8,EU27,DE 21.7 21.7 21.7 21.7 22.0 22.1 22.5 22.0 21.9 21.3 21.0 20.5 20.3 20.3 19.8 19.8 19.5 False
DE CONT_EXP_EU,SITC6_8,EU28,DE 21.6 21.6 21.6 21.7 21.9 22.0 22.5 21.9 21.9 21.3 20.9 20.5 20.3 20.3 : : : False
DE CONT_EXP_EU,SITC6_8,EXT_EU27,DE 23.5 23.7 24.1 24.5 25.0 25.0 24.9 24.2 23.7 23.5 22.2 22.3 21.6 21.0 20.6 20.3 21.2 False
DE CONT_EXP_EU,SITC6_8,EXT_EU28,DE 23.5 23.7 24.1 24.5 25.0 25.0 24.9 24.2 23.7 23.5 22.2 22.4 21.7 21.0 : : : False
DE CONT_EXP_EU,SITC7,EU27,DE 27.2 27.2 27.1 27.5 27.7 27.3 27.3 28.1 28.5 26.6 27.7 27.6 27.4 26.5 25.8 25.4 25.9 False
DE CONT_EXP_EU,SITC7,EU28,DE 27.2 27.1 27.0 27.5 27.6 27.3 27.3 28.0 28.4 26.5 27.6 27.5 27.4 26.5 : : : False
DE CONT_EXP_EU,SITC7,EXT_EU27,DE 38.4 38.3 37.7 37.9 37.5 37.3 35.5 35.0 35.1 35.7 33.8 35.3 35.4 35.3 33.2 30.8 31.5 False
DE CONT_EXP_EU,SITC7,EXT_EU28,DE 38.4 38.3 37.7 37.9 37.5 37.4 35.5 35.1 35.1 35.7 33.8 35.3 35.4 35.3 : : : False
DE CONT_EXP_EU,SITC9,EU27,DE 32.4 32.3 30.7 29.8 30.4 26.3 32.4 37.7 36.8 42.1 38.0 42.0 43.6 36.6 42.0 42.1 47.0 True
DE CONT_EXP_EU,SITC9,EU28,DE 32.4 32.3 30.6 29.7 30.3 26.4 32.3 37.6 36.7 41.9 37.8 41.9 43.7 36.6 : : : True
DE CONT_EXP_EU,SITC9,EXT_EU27,DE 18.5 19.7 12.0 26.3 20.5 22.5 25.7 30.3 37.6 38.2 32.4 26.0 30.9 30.7 28.3 25.5 27.0 False
DE CONT_EXP_EU,SITC9,EXT_EU28,DE 18.4 19.7 12.0 26.3 20.5 22.5 25.7 30.3 37.7 38.4 32.5 26.0 31.4 30.7 : : : False
DE CONT_EXP_EU,TOTAL,EU27,DE 22.7 22.2 21.8 21.9 22.4 22.5 22.8 22.9 23.4 22.5 22.6 22.8 22.5 21.8 21.7 21.4 21.9 False
DE CONT_EXP_EU,TOTAL,EU28,DE 22.6 22.1 21.8 21.8 22.3 22.4 22.7 22.8 23.4 22.4 22.6 22.7 22.5 21.7 : : : False
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
DE PC_TOT_IMP,SITC0_1,EXT_EU27,DE 22.6 21.6 20.9 22.9 24.0 22.3 21.4 21.5 21.5 21.0 20.7 20.0 20.0 21.0 22.1 23.1 23.0 False
DE PC_TOT_IMP,SITC0_1,EXT_EU28,DE 22.5 21.5 20.8 22.8 23.9 22.2 21.4 21.5 21.4 21.0 20.6 20.0 19.9 21.0 22.0 23.0 23.0 False
DE PC_TOT_IMP,SITC2_4,EU27,DE 68.0 66.6 66.3 64.5 64.3 65.4 66.3 65.0 65.3 64.2 66.3 64.1 64.4 62.9 59.4 58.1 58.8 True
DE PC_TOT_IMP,SITC2_4,EU28,DE 68.2 66.7 66.4 64.6 64.4 65.5 66.4 65.1 65.4 64.3 66.4 64.3 64.5 63.2 59.5 58.3 58.9 True
DE PC_TOT_IMP,SITC2_4,EXT_EU27,DE 32.0 33.4 33.7 35.5 35.7 34.6 33.7 35.0 34.7 35.8 33.7 35.9 35.6 37.1 40.6 41.9 41.2 False
DE PC_TOT_IMP,SITC2_4,EXT_EU28,DE 31.8 33.3 33.6 35.4 35.6 34.5 33.6 34.9 34.6 35.7 33.6 35.7 35.5 36.8 40.5 41.7 41.1 False
DE PC_TOT_IMP,SITC3,EU27,DE 44.2 41.1 41.2 39.7 41.2 40.7 37.9 37.0 37.7 38.4 41.3 41.4 37.2 37.7 39.9 38.7 37.1 True
DE PC_TOT_IMP,SITC3,EU28,DE 44.2 41.1 41.2 39.7 41.2 40.7 37.9 37.0 37.8 38.4 41.3 41.4 37.2 37.7 39.9 38.7 37.1 True
DE PC_TOT_IMP,SITC3,EXT_EU27,DE 55.8 58.9 58.8 60.3 58.8 59.3 62.1 63.0 62.3 61.6 58.7 58.6 62.8 62.3 60.1 61.3 62.9 False
DE PC_TOT_IMP,SITC3,EXT_EU28,DE 55.8 58.9 58.8 60.3 58.8 59.3 62.1 63.0 62.2 61.6 58.7 58.6 62.8 62.3 60.1 61.3 62.9 False
DE PC_TOT_IMP,SITC5,EU27,DE 74.5 75.4 75.6 75.9 76.4 77.0 77.3 77.9 78.3 78.1 79.0 76.9 76.8 75.8 75.7 74.5 74.5 False
DE PC_TOT_IMP,SITC5,EU28,DE 74.6 75.4 75.7 75.9 76.4 77.0 77.4 77.9 78.4 78.2 79.1 77.0 76.9 75.8 75.7 74.6 74.6 False
DE PC_TOT_IMP,SITC5,EXT_EU27,DE 25.5 24.6 24.4 24.1 23.6 23.0 22.7 22.1 21.7 21.9 21.0 23.1 23.2 24.2 24.3 25.5 25.5 True
DE PC_TOT_IMP,SITC5,EXT_EU28,DE 25.4 24.6 24.3 24.1 23.6 23.0 22.6 22.1 21.6 21.8 20.9 23.0 23.1 24.2 24.3 25.4 25.4 True
DE PC_TOT_IMP,SITC6_8,EU27,DE 64.0 65.3 65.3 64.5 63.8 63.3 63.2 64.7 64.7 65.3 65.9 65.3 65.8 65.5 63.8 63.6 65.0 True
DE PC_TOT_IMP,SITC6_8,EU28,DE 64.2 65.6 65.5 64.6 64.0 63.5 63.4 64.9 64.9 65.5 66.1 65.5 66.0 65.8 64.1 63.9 65.4 True
DE PC_TOT_IMP,SITC6_8,EXT_EU27,DE 36.0 34.7 34.7 35.5 36.2 36.7 36.8 35.3 35.3 34.7 34.1 34.7 34.2 34.5 36.2 36.4 35.0 False
DE PC_TOT_IMP,SITC6_8,EXT_EU28,DE 35.8 34.4 34.5 35.4 36.0 36.5 36.6 35.1 35.1 34.5 33.9 34.5 34.0 34.2 35.9 36.1 34.6 False
DE PC_TOT_IMP,SITC7,EU27,DE 66.8 68.1 67.3 65.8 65.2 62.8 66.9 65.5 65.1 63.8 63.6 64.3 66.1 66.2 64.4 61.0 64.1 True
DE PC_TOT_IMP,SITC7,EU28,DE 66.9 68.2 67.4 65.9 65.3 62.8 67.0 65.6 65.2 64.0 63.7 64.4 66.1 66.3 64.5 61.1 64.2 True
DE PC_TOT_IMP,SITC7,EXT_EU27,DE 33.2 31.9 32.7 34.2 34.8 37.2 33.1 34.5 34.9 36.2 36.4 35.7 33.9 33.8 35.6 39.0 35.9 False
DE PC_TOT_IMP,SITC7,EXT_EU28,DE 33.1 31.8 32.6 34.1 34.7 37.2 33.0 34.4 34.8 36.0 36.3 35.6 33.9 33.7 35.5 38.9 35.8 False
DE PC_TOT_IMP,SITC9,EU27,DE 48.1 47.2 44.0 51.7 51.0 54.9 52.6 62.9 62.6 60.5 56.0 81.4 79.1 71.8 78.7 83.3 86.8 False
DE PC_TOT_IMP,SITC9,EU28,DE 48.1 47.2 44.1 51.9 51.1 55.1 52.8 63.0 62.7 60.7 56.2 81.5 79.2 71.8 78.7 83.4 86.9 False
DE PC_TOT_IMP,SITC9,EXT_EU27,DE 51.9 52.8 56.0 48.3 49.0 45.1 47.4 37.1 37.4 39.5 44.0 18.6 20.9 28.2 21.3 16.7 13.2 True
DE PC_TOT_IMP,SITC9,EXT_EU28,DE 51.9 52.8 55.9 48.1 48.9 44.9 47.2 37.0 37.3 39.3 43.8 18.5 20.8 28.2 21.3 16.6 13.1 True
DE PC_TOT_IMP,TOTAL,EU27,DE 65.6 65.4 64.6 63.5 63.4 63.2 64.6 63.6 64.6 63.7 64.5 65.7 66.1 65.7 64.6 63.2 66.0 True
DE PC_TOT_IMP,TOTAL,EU28,DE 65.7 65.5 64.7 63.6 63.5 63.3 64.7 63.7 64.7 63.8 64.6 65.8 66.2 65.8 64.7 63.3 66.2 True
DE PC_TOT_IMP,TOTAL,EXT_EU27,DE 34.4 34.6 35.4 36.5 36.6 36.8 35.4 36.4 35.4 36.3 35.5 34.3 33.9 34.3 35.4 36.8 34.0 False
DE PC_TOT_IMP,TOTAL,EXT_EU28,DE 34.3 34.5 35.3 36.4 36.5 36.7 35.3 36.3 35.3 36.2 35.4 34.2 33.8 34.2 35.3 36.7 33.8 False

328 rows × 19 columns

Row index with "iloc" method


In [53]:
# now filter based on row index for the top 100 rows

trade.iloc[:100]


Out[53]:
indic_et,sitc06,partner,geo\time 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002 2001 2000 1999 2013inc
geo
AT CONT_EXP_EU,SITC0_1,EU27,AT 2.4 2.5 2.4 2.5 2.5 2.5 2.6 2.6 2.6 2.6 2.5 2.4 2.4 2.1 2.1 2.0 1.9 False
BE CONT_EXP_EU,SITC0_1,EU27,BE 9.1 9.0 9.0 9.2 9.1 9.1 9.6 9.4 9.5 9.6 9.9 10.1 10.2 10.4 10.5 10.4 10.6 False
BG CONT_EXP_EU,SITC0_1,EU27,BG 0.6 0.6 0.6 0.6 0.6 0.6 0.5 0.4 0.3 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.2 False
CY CONT_EXP_EU,SITC0_1,EU27,CY 0.1 0.1 0.1 0.0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 True
CZ CONT_EXP_EU,SITC0_1,EU27,CZ 1.9 1.7 1.6 1.6 1.5 1.4 1.4 1.4 1.3 1.1 1.1 0.9 0.7 0.7 0.6 0.6 0.5 False
DE CONT_EXP_EU,SITC0_1,EU27,DE 16.0 16.3 16.3 16.0 16.0 16.0 16.4 16.3 16.2 15.7 15.5 14.7 14.4 14.1 14.2 13.7 13.1 True
DK CONT_EXP_EU,SITC0_1,EU27,DK 3.4 3.6 3.6 3.7 3.8 4.1 4.1 4.1 4.3 4.8 4.6 4.7 4.8 5.1 5.3 5.2 5.1 False
EE CONT_EXP_EU,SITC0_1,EU27,EE 0.2 0.3 0.3 0.3 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.1 0.1 0.1 0.1 False
EL CONT_EXP_EU,SITC0_1,EU27,EL 1.1 1.1 1.0 1.1 1.1 1.2 1.2 1.1 1.1 1.1 1.1 1.1 0.9 0.9 1.2 1.2 1.2 False
ES CONT_EXP_EU,SITC0_1,EU27,ES 9.3 8.8 8.8 8.7 8.6 8.7 8.6 8.4 8.3 8.6 8.8 9.2 9.7 9.3 9.2 8.6 7.7 True
EU27 CONT_EXP_EU,SITC0_1,EU27,EU27 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 False
FI CONT_EXP_EU,SITC0_1,EU27,FI 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 False
FR CONT_EXP_EU,SITC0_1,EU27,FR 10.9 11.6 12.1 12.3 12.6 12.2 12.8 13.5 13.9 14.1 14.4 15.3 15.9 15.9 15.7 16.9 17.9 False
HU CONT_EXP_EU,SITC0_1,EU27,HU 1.7 1.7 1.8 1.9 1.9 1.6 1.5 1.6 1.5 1.2 1.1 1.1 1.1 1.0 1.1 1.0 1.0 False
IE CONT_EXP_EU,SITC0_1,EU27,IE 2.6 2.5 2.5 2.5 2.6 2.6 2.6 2.7 3.1 3.2 3.1 3.2 3.2 3.2 3.2 3.4 3.4 False
IT CONT_EXP_EU,SITC0_1,EU27,IT 7.0 6.9 6.8 6.9 7.0 7.2 7.1 7.1 7.1 7.0 7.1 7.2 7.1 7.3 7.3 7.1 7.5 False
LT CONT_EXP_EU,SITC0_1,EU27,LT 0.8 0.8 0.7 0.7 0.7 0.6 0.6 0.6 0.6 0.5 0.4 0.3 0.2 0.2 0.2 0.2 0.1 False
LU CONT_EXP_EU,SITC0_1,EU27,LU 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.4 0.4 0.4 0.4 0.4 0.4 0.4 False
LV CONT_EXP_EU,SITC0_1,EU27,LV 0.3 0.3 0.4 0.4 0.3 0.3 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.1 0.1 0.0 0.0 False
MT CONT_EXP_EU,SITC0_1,EU27,MT 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 False
NL CONT_EXP_EU,SITC0_1,EU27,NL 16.3 16.7 16.9 16.7 17.1 17.4 17.2 17.3 17.1 17.3 17.7 18.1 18.2 18.7 18.7 18.7 18.8 True
PL CONT_EXP_EU,SITC0_1,EU27,PL 5.7 5.4 5.0 4.7 4.2 4.1 3.8 3.7 3.4 3.1 2.7 2.1 1.5 1.3 1.3 1.2 1.1 True
PT CONT_EXP_EU,SITC0_1,EU27,PT 1.3 1.2 1.2 1.1 1.2 1.2 1.2 1.2 1.1 1.1 1.0 0.9 0.9 0.9 0.9 0.9 0.8 True
RO CONT_EXP_EU,SITC0_1,EU27,RO 0.9 0.9 0.8 0.8 0.8 0.7 0.6 0.4 0.3 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1 False
SE CONT_EXP_EU,SITC0_1,EU27,SE 1.8 1.8 1.7 1.6 1.6 1.6 1.5 1.4 1.4 1.4 1.3 1.2 1.1 1.0 0.9 0.9 0.9 True
SI CONT_EXP_EU,SITC0_1,EU27,SI 0.3 0.3 0.3 0.4 0.3 0.3 0.3 0.3 0.3 0.2 0.1 0.1 0.1 0.1 0.0 0.1 0.1 False
SK CONT_EXP_EU,SITC0_1,EU27,SK 0.7 0.7 0.8 0.9 0.8 0.7 0.7 0.6 0.7 0.6 0.5 0.4 0.3 0.3 0.2 0.2 0.2 False
UK CONT_EXP_EU,SITC0_1,EU27,UK 4.8 4.7 4.6 4.8 4.9 5.0 4.8 4.9 5.1 5.2 5.3 5.7 5.9 6.0 5.9 6.7 7.0 False
AT CONT_EXP_EU,SITC0_1,EU28,AT 2.4 2.5 2.5 2.5 2.5 2.6 2.6 2.7 2.6 2.6 2.5 2.5 2.4 2.2 : : : False
BE CONT_EXP_EU,SITC0_1,EU28,BE 9.0 8.9 8.9 9.2 9.1 9.1 9.6 9.4 9.4 9.6 9.9 10.1 10.2 10.4 : : : False
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
HU CONT_EXP_EU,SITC0_1,EXT_EU27,HU 1.1 1.1 1.1 1.2 1.2 1.2 1.1 1.3 1.2 1.4 1.3 1.3 1.4 1.6 1.6 1.4 1.2 False
IE CONT_EXP_EU,SITC0_1,EXT_EU27,IE 2.6 2.6 2.4 2.3 2.1 2.0 1.9 2.2 3.0 3.2 3.0 3.0 3.0 3.0 3.6 4.0 4.0 True
IT CONT_EXP_EU,SITC0_1,EXT_EU27,IT 10.0 9.5 9.3 9.2 9.3 9.5 10.1 10.0 9.9 9.8 9.9 10.1 10.1 10.0 9.5 8.8 8.8 True
LT CONT_EXP_EU,SITC0_1,EXT_EU27,LT 1.3 1.8 2.1 1.9 1.5 1.4 1.3 1.5 1.1 0.9 0.6 0.5 0.6 0.4 0.5 0.4 0.3 True
LU CONT_EXP_EU,SITC0_1,EXT_EU27,LU 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 False
LV CONT_EXP_EU,SITC0_1,EXT_EU27,LV 0.7 0.9 1.0 1.0 0.7 0.6 0.6 0.7 0.4 0.4 0.3 0.2 0.2 0.2 0.2 0.1 0.1 False
MT CONT_EXP_EU,SITC0_1,EXT_EU27,MT 0.2 0.2 0.2 0.2 0.1 0.2 0.1 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.1 False
NL CONT_EXP_EU,SITC0_1,EXT_EU27,NL 13.2 13.6 13.0 12.8 13.0 13.7 14.0 13.0 13.7 13.3 13.1 13.5 13.7 13.8 12.9 12.8 12.4 True
PL CONT_EXP_EU,SITC0_1,EXT_EU27,PL 3.7 4.1 4.0 4.0 3.5 3.5 3.3 3.0 3.0 3.0 3.1 2.6 2.5 2.2 2.2 2.0 1.9 False
PT CONT_EXP_EU,SITC0_1,EXT_EU27,PT 1.3 1.5 1.4 1.4 1.4 1.3 1.4 1.3 1.2 1.2 0.9 0.9 0.9 0.9 0.8 0.8 0.8 False
RO CONT_EXP_EU,SITC0_1,EXT_EU27,RO 1.7 1.7 1.8 1.1 1.0 0.9 0.7 0.9 0.3 0.4 0.3 0.3 0.2 0.3 0.2 0.2 0.3 True
SE CONT_EXP_EU,SITC0_1,EXT_EU27,SE 1.8 1.9 1.9 1.8 1.7 1.9 1.8 2.0 2.0 2.1 2.3 2.2 2.1 2.0 1.9 1.8 1.6 True
SI CONT_EXP_EU,SITC0_1,EXT_EU27,SI 0.5 0.5 0.4 0.4 0.4 0.5 0.5 0.5 0.4 0.4 0.4 0.4 0.6 0.6 0.6 0.5 0.5 False
SK CONT_EXP_EU,SITC0_1,EXT_EU27,SK 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.2 0.1 0.1 0.1 0.1 0.1 0.1 False
UK CONT_EXP_EU,SITC0_1,EXT_EU27,UK 8.9 8.6 8.3 8.7 8.7 8.4 8.3 7.9 8.8 9.5 10.4 11.0 11.6 11.9 12.3 12.9 13.3 False
AT CONT_EXP_EU,SITC0_1,EXT_EU28,AT 2.0 2.0 2.1 2.2 2.2 2.1 2.2 2.3 2.6 2.9 2.5 2.0 1.7 1.5 : : : False
BE CONT_EXP_EU,SITC0_1,EXT_EU28,BE 4.4 4.5 4.3 4.3 4.5 4.7 4.8 5.5 5.3 5.0 5.1 4.7 4.2 4.3 : : : False
BG CONT_EXP_EU,SITC0_1,EXT_EU28,BG 1.0 1.0 1.1 0.8 0.8 0.8 0.7 0.9 0.6 0.6 0.7 0.6 0.5 0.6 : : : True
CY CONT_EXP_EU,SITC0_1,EXT_EU28,CY 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 : : : False
CZ CONT_EXP_EU,SITC0_1,EXT_EU28,CZ 0.5 0.5 0.5 0.4 0.4 0.4 0.4 0.4 0.4 0.5 0.6 0.4 0.5 0.4 : : : True
DE CONT_EXP_EU,SITC0_1,EXT_EU28,DE 12.6 12.4 12.4 12.9 13.0 13.0 13.4 12.7 11.6 11.4 10.5 9.7 10.0 10.1 : : : False
DK CONT_EXP_EU,SITC0_1,EXT_EU28,DK 4.3 4.2 4.4 4.4 4.7 5.0 5.2 5.2 5.5 5.6 6.2 6.6 6.5 6.7 : : : False
EE CONT_EXP_EU,SITC0_1,EXT_EU28,EE 0.3 0.3 0.4 0.4 0.4 0.4 0.3 0.4 0.4 0.3 0.2 0.2 0.2 0.2 : : : False
EL CONT_EXP_EU,SITC0_1,EXT_EU28,EL 1.1 1.1 1.1 1.2 1.1 1.3 1.5 1.4 1.4 1.4 1.4 1.3 1.4 1.7 : : : False
ES CONT_EXP_EU,SITC0_1,EXT_EU28,ES 7.7 7.4 7.1 7.5 7.1 6.7 6.6 6.6 6.8 6.3 6.3 6.6 6.5 6.5 : : : False
EU28 CONT_EXP_EU,SITC0_1,EXT_EU28,EU28 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 : : : False
FI CONT_EXP_EU,SITC0_1,EXT_EU28,FI 0.4 0.6 0.7 0.7 0.8 0.7 0.7 0.8 0.8 0.8 0.7 0.8 0.8 0.9 : : : False
FR CONT_EXP_EU,SITC0_1,EXT_EU28,FR 18.2 17.6 18.7 18.8 20.3 19.3 18.6 19.1 18.6 19.0 19.1 19.4 20.2 19.8 : : : False
HR CONT_EXP_EU,SITC0_1,EXT_EU28,HR 0.6 0.6 0.6 0.7 0.7 0.7 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 : : : False
HU CONT_EXP_EU,SITC0_1,EXT_EU28,HU 1.0 1.0 0.9 1.0 1.1 1.1 1.0 1.2 1.1 1.3 1.2 1.2 1.3 1.4 : : : False

100 rows × 19 columns


In [ ]: