Introducion

For Context according to globalissues.org Global military expenditure stands at over $1.7 trillion in annual expenditure for 2012. the United States is considered a superpower and spends an exorbitant amount of money of their military I want to see how the United States compared to other countries Specicfiaclly BRIC countries. BRIC is an acronym referring to Brazil, Russia, India, and China countries considered on their way to being developed if not already developed. These countries are considered to have economic influence against the U.S. I wanted to see just out of my own curiosity if they can have so much influence over the U.S. economy if they can also have some influence militarily.

Method

In order to conduct this research to answer this problem, I will use Military spending around the world as my identifier to Military influence. I will be using a Jupyter notebook using Pandas and matlplotlib to make data Visualization in order to look at how these countries compare. I will Also Be using Scikit Learn to Apply a simple Linear Regression For a Predictive Analytic. First I found the data set on Kaggle Second, I cleaned the data, I will Get into how to lean data sets in a later video

Results

In [4]:
import numpy as np
import pandas as pd 
import matplotlib.pyplot as plt
import seaborn as sns
In [5]:
df = pd.read_csv('Military Expenditure.csv')
In [6]:
df = df.drop(['Indicator Name'], axis=1)
In [7]:
df.shape
Out[7]:
(264, 62)
In [8]:
df.head(300)
Out[8]:
Name Code Type 1960 1961 1962 1963 1964 1965 1966 ... 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
0 Aruba ABW Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
1 Afghanistan AFG Country NaN NaN NaN NaN NaN NaN NaN ... 2.518695e+08 2.981469e+08 3.258070e+08 2.385834e+08 2.171941e+08 2.682271e+08 1.995186e+08 1.858783e+08 1.914071e+08 1.980863e+08
2 Angola AGO Country NaN NaN NaN NaN NaN NaN NaN ... 3.311193e+09 3.500795e+09 3.639496e+09 4.144635e+09 6.090752e+09 6.841864e+09 3.608299e+09 2.764055e+09 3.062873e+09 1.983614e+09
3 Albania ALB Country NaN NaN NaN NaN NaN NaN NaN ... 1.827369e+08 1.858932e+08 1.970068e+08 1.832047e+08 1.800155e+08 1.781204e+08 1.323507e+08 1.308532e+08 1.443827e+08 1.804887e+08
4 Andorra AND Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
5 Arab World ARB Regions Clubbed Geographically NaN NaN 8.332295e+08 9.164461e+08 1.225339e+09 1.416443e+09 1.548666e+09 ... 9.150404e+10 9.797637e+10 1.080000e+11 1.220000e+11 1.430000e+11 1.550000e+11 1.380000e+11 1.120000e+11 1.190000e+11 1.130000e+11
6 United Arab Emirates ARE Country NaN NaN NaN NaN NaN NaN NaN ... 1.383635e+10 1.750470e+10 1.918176e+10 1.902410e+10 2.356106e+10 2.275507e+10 NaN NaN NaN NaN
7 Argentina ARG Country NaN NaN 3.051624e+08 2.422198e+08 2.457405e+08 2.524076e+08 2.792254e+08 ... 2.981852e+09 3.475348e+09 4.051930e+09 4.563218e+09 5.137974e+09 4.979443e+09 5.482617e+09 4.509648e+09 5.459644e+09 4.144992e+09
8 Armenia ARM Country NaN NaN NaN NaN NaN NaN NaN ... 3.594993e+08 3.950115e+08 3.908714e+08 3.805717e+08 4.445519e+08 4.578070e+08 4.473798e+08 4.313962e+08 4.436104e+08 6.088546e+08
9 American Samoa ASM Semi Autonomous Region NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
10 Antigua and Barbuda ATG Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
11 Australia AUS Country 4.597601e+08 4.709601e+08 4.894401e+08 5.532801e+08 6.557601e+08 7.873601e+08 9.867202e+08 ... 1.896014e+10 2.321769e+10 2.659720e+10 2.621658e+10 2.482526e+10 2.578371e+10 2.404557e+10 2.638295e+10 2.769111e+10 2.671183e+10
12 Austria AUT Country 9.155910e+07 9.102985e+07 1.000270e+08 1.259599e+08 1.645947e+08 1.428957e+08 1.677701e+08 ... 3.334755e+09 3.218351e+09 3.409721e+09 3.187227e+09 3.229066e+09 3.305159e+09 2.665410e+09 2.885947e+09 3.138359e+09 3.367460e+09
13 Azerbaijan AZE Country NaN NaN NaN NaN NaN NaN NaN ... 1.472910e+09 1.476609e+09 3.080085e+09 3.246123e+09 3.367574e+09 3.427180e+09 2.943397e+09 1.396969e+09 1.528860e+09 1.708941e+09
14 Burundi BDI Country NaN NaN 8.420000e+06 1.012000e+06 1.162000e+06 2.153481e+06 2.286857e+06 ... NaN NaN NaN 5.896666e+07 6.085950e+07 6.217729e+07 6.616458e+07 6.646284e+07 6.390868e+07 6.543660e+07
15 Belgium BEL Country 3.832202e+08 3.912188e+08 4.222208e+08 4.446013e+08 4.970592e+08 5.007221e+08 5.633779e+08 ... 5.620670e+09 5.244721e+09 5.499371e+09 5.168998e+09 5.263165e+09 5.191509e+09 4.202063e+09 4.314102e+09 4.484653e+09 4.959692e+09
16 Benin BEN Country 1.301005e+06 2.173204e+06 2.734538e+06 2.963072e+06 3.803662e+06 3.994924e+06 3.724387e+06 ... NaN NaN NaN 7.822309e+07 8.600316e+07 9.299071e+07 9.089609e+07 7.958157e+07 1.161428e+08 9.021243e+07
17 Burkina Faso BFA Country 1.268378e+06 1.643154e+06 4.901761e+06 5.281288e+06 5.358593e+06 3.509330e+06 3.907554e+06 ... 1.273333e+08 1.237005e+08 1.388509e+08 1.477297e+08 1.661363e+08 1.771670e+08 1.479347e+08 1.494674e+08 1.910658e+08 3.124676e+08
18 Bangladesh BGD Country NaN NaN NaN NaN NaN NaN NaN ... 1.258791e+09 1.624625e+09 1.801540e+09 1.823425e+09 2.047989e+09 2.355992e+09 2.815282e+09 3.239739e+09 3.594008e+09 3.894695e+09
19 Bulgaria BGR Country NaN NaN NaN NaN NaN NaN NaN ... 9.632542e+08 8.934675e+08 8.290318e+08 8.075293e+08 8.995840e+08 8.357170e+08 6.608479e+08 7.554065e+08 8.241870e+08 1.095591e+09
20 Bahrain BHR Country NaN NaN NaN NaN NaN NaN NaN ... 8.281915e+08 8.428191e+08 1.033511e+09 1.182181e+09 1.347606e+09 1.475266e+09 1.442021e+09 1.505535e+09 1.532713e+09 1.396809e+09
21 Bahamas BHS Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
22 Bosnia and Herzegovina BIH Country NaN NaN NaN NaN NaN NaN NaN ... 2.424714e+08 2.199155e+08 2.118783e+08 1.973447e+08 1.976172e+08 1.903805e+08 1.622157e+08 1.579120e+08 1.646381e+08 2.211316e+08
23 Belarus BLR Country NaN NaN NaN NaN NaN NaN NaN ... 6.754265e+08 7.676993e+08 7.562774e+08 8.170699e+08 9.711078e+08 1.010827e+09 7.236600e+08 5.972076e+08 6.311454e+08 7.151667e+08
24 Belize BLZ Country NaN NaN NaN NaN NaN NaN NaN ... 1.726754e+07 1.533725e+07 1.541625e+07 1.521912e+07 1.777888e+07 1.991688e+07 1.971762e+07 2.171289e+07 2.345675e+07 2.308311e+07
25 Bermuda BMU Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
26 Bolivia BOL Country NaN 4.935418e+06 5.195619e+06 6.404292e+06 NaN NaN NaN ... 3.457778e+08 3.274131e+08 4.035686e+08 4.998700e+08 5.644098e+08 6.258851e+08 5.755242e+08 5.523813e+08 5.740702e+08 6.188421e+08
27 Brazil BRA Country 3.827298e+08 3.423397e+08 3.874490e+08 4.419996e+08 3.542279e+08 6.328690e+08 7.182166e+08 ... 2.564881e+10 3.400294e+10 3.693621e+10 3.398701e+10 3.287479e+10 3.265961e+10 2.461770e+10 2.422475e+10 2.928305e+10 2.776643e+10
28 Barbados BRB Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
29 Brunei Darussalam BRN Country NaN NaN NaN NaN NaN NaN NaN ... 3.497597e+08 3.907195e+08 4.153715e+08 4.112615e+08 4.120943e+08 5.277852e+08 4.240220e+08 4.033665e+08 3.467068e+08 3.465887e+08
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
234 Latin America & the Caribbean (IDA & IBRD coun... TLA Regions Clubbed Economically 1.041102e+09 9.521159e+08 1.470078e+09 1.558299e+09 1.478294e+09 1.824899e+09 1.976690e+09 ... 5.652421e+10 6.948861e+10 7.469882e+10 7.649189e+10 7.973844e+10 7.455081e+10 6.156557e+10 5.727127e+10 6.557719e+10 6.418384e+10
235 Timor-Leste TLS Country NaN NaN NaN NaN NaN NaN NaN ... 3.648100e+07 2.638900e+07 2.053000e+07 3.338800e+07 3.168300e+07 2.962400e+07 3.695900e+07 2.621700e+07 2.544200e+07 2.061000e+07
236 Middle East & North Africa (IDA & IBRD countries) TMN Regions Clubbed Economically NaN NaN 8.303662e+08 8.987564e+08 1.209936e+09 1.377120e+09 1.447511e+09 ... 3.533690e+10 3.806224e+10 4.305891e+10 4.643928e+10 4.811780e+10 4.587827e+10 4.418341e+10 4.165398e+10 4.288774e+10 4.148024e+10
237 Tonga TON Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
238 South Asia (IDA & IBRD) TSA Regions Clubbed Economically 9.072639e+08 9.755770e+08 1.281626e+09 2.029027e+09 2.258474e+09 2.580099e+09 2.226113e+09 ... 4.723932e+10 5.577481e+10 6.075238e+10 5.848949e+10 5.919605e+10 6.443596e+10 6.617543e+10 7.213496e+10 8.207734e+10 8.405855e+10
239 Sub-Saharan Africa (IDA & IBRD countries) TSS Regions Clubbed Economically NaN NaN NaN 4.222638e+08 5.457222e+08 6.693097e+08 7.135174e+08 ... 1.783993e+10 1.659735e+10 1.823214e+10 1.876137e+10 2.175311e+10 2.327820e+10 2.025452e+10 1.912811e+10 2.163284e+10 1.832208e+10
240 Trinidad and Tobago TTO Country NaN NaN NaN NaN NaN NaN NaN ... 1.385237e+08 1.430631e+08 1.460807e+08 1.687624e+08 2.111760e+08 1.888859e+08 2.021069e+08 2.162767e+08 2.027670e+08 1.693325e+08
241 Tunisia TUN Country 1.595238e+07 1.857143e+07 1.428571e+07 1.523810e+07 1.747899e+07 1.276190e+07 1.371429e+07 ... 5.647759e+08 5.711890e+08 7.152396e+08 6.812260e+08 7.593589e+08 9.083573e+08 9.794940e+08 9.877347e+08 8.589496e+08 8.442274e+08
242 Turkey TUR Country 4.688109e+08 3.013304e+08 3.303769e+08 3.500000e+08 3.808978e+08 4.226770e+08 4.420354e+08 ... 1.635230e+10 1.793937e+10 1.730488e+10 1.795824e+10 1.866257e+10 1.777217e+10 1.588093e+10 1.785398e+10 1.782401e+10 1.896711e+10
243 Tuvalu TUV Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
244 Tanzania TZA Country NaN NaN NaN NaN NaN NaN NaN ... 2.194769e+08 2.827251e+08 3.074740e+08 3.597394e+08 4.433799e+08 5.072872e+08 5.170758e+08 5.442183e+08 6.112156e+08 6.754752e+08
245 Uganda UGA Country NaN NaN 7.279854e+05 2.729945e+06 5.487890e+06 1.073779e+07 1.426571e+07 ... 2.935277e+08 6.086859e+08 6.071351e+08 3.518382e+08 3.000756e+08 3.256628e+08 3.061404e+08 3.185517e+08 3.467629e+08 4.083676e+08
246 Ukraine UKR Country NaN NaN NaN NaN NaN NaN NaN ... 3.452467e+09 3.729504e+09 3.684691e+09 4.136888e+09 4.386463e+09 4.033331e+09 3.616896e+09 3.423287e+09 3.647565e+09 4.750219e+09
247 Upper middle income UMC Regions Clubbed Economically NaN NaN NaN NaN NaN NaN NaN ... 2.730000e+11 3.060000e+11 3.520000e+11 3.910000e+11 4.260000e+11 4.350000e+11 4.130000e+11 4.110000e+11 4.320000e+11 4.490000e+11
248 Uruguay URY Country NaN NaN NaN NaN NaN NaN NaN ... 5.770560e+08 7.556595e+08 8.248335e+08 9.246403e+08 1.045084e+09 1.034501e+09 9.699068e+08 9.882236e+08 1.165710e+09 1.168131e+09
249 United States USA Country 4.538000e+10 4.780800e+10 5.238100e+10 5.229500e+10 5.121300e+10 5.182700e+10 6.357200e+10 ... 6.690000e+11 6.980000e+11 7.110000e+11 6.850000e+11 6.400000e+11 6.100000e+11 5.960000e+11 6.000000e+11 6.060000e+11 6.490000e+11
250 Uzbekistan UZB Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
251 St. Vincent and the Grenadines VCT Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
252 Venezuela VEN Country 2.343577e+08 1.146327e+08 2.039007e+08 2.453973e+08 2.004598e+08 2.272727e+08 2.386364e+08 ... 4.055380e+09 3.991195e+09 3.577532e+09 5.114847e+09 6.199698e+09 1.554727e+09 3.205392e+08 2.181549e+08 4.648218e+08 NaN
253 British Virgin Islands VGB Semi Autonomous Region NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
254 Virgin Islands (U.S.) VIR Semi Autonomous Region NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
255 Vietnam VNM Country NaN NaN NaN NaN NaN NaN NaN ... 2.401451e+09 2.672286e+09 2.686521e+09 3.360860e+09 3.727249e+09 4.255722e+09 4.562633e+09 5.017402e+09 5.073854e+09 5.500000e+09
256 Vanuatu VUT Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
257 World WLD Regions Clubbed Geographically NaN NaN NaN NaN NaN NaN NaN ... 1.550000e+12 1.630000e+12 1.730000e+12 1.740000e+12 1.740000e+12 1.740000e+12 1.640000e+12 1.630000e+12 1.700000e+12 1.780000e+12
258 Samoa WSM Country NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
259 Kosovo XKX Country NaN NaN NaN NaN NaN NaN NaN ... 2.722709e+07 3.857812e+07 5.096886e+07 4.339040e+07 4.859768e+07 5.357579e+07 4.998416e+07 5.193762e+07 5.726263e+07 6.334407e+07
260 Yemen, Rep. YEM Country NaN NaN NaN NaN NaN NaN NaN ... 1.420775e+09 1.448153e+09 1.612254e+09 1.618840e+09 1.648751e+09 1.714831e+09 NaN NaN NaN NaN
261 South Africa ZAF Country 6.999997e+07 1.137500e+08 1.861999e+08 1.889999e+08 2.715999e+08 2.894499e+08 3.244499e+08 ... 3.592688e+09 4.188168e+09 4.594154e+09 4.489590e+09 4.118208e+09 3.892469e+09 3.488868e+09 3.169756e+09 3.638937e+09 3.639879e+09
262 Zambia ZMB Country NaN NaN NaN NaN NaN NaN NaN ... 2.209623e+08 2.801878e+08 3.091138e+08 3.463014e+08 3.813458e+08 4.436044e+08 3.724476e+08 2.995048e+08 3.396645e+08 3.780254e+08
263 Zimbabwe ZWE Country NaN NaN NaN NaN NaN 1.560000e+07 1.695000e+07 ... NaN 9.829300e+07 1.984380e+08 3.182720e+08 3.567000e+08 3.681000e+08 3.766770e+08 3.580650e+08 3.405220e+08 4.203640e+08

264 rows × 62 columns

In [9]:
Countires = df[df['Type']=='Country'] # isolates the data points to countires
Countires = Countires.drop(['Code', 'Type'], axis=1) # drops code/type
Countires = Countires.set_index('Name')
Countires.index = Countires.index.rename('Year')
Countires = Countires.dropna(axis=0, how='all') # if a column is all null drop
Countires = Countires.T # the countries are now columns
Countires = Countires.fillna(Countires.mean())
Countires.head(100)
Out[9]:
Year Afghanistan Angola Albania United Arab Emirates Argentina Armenia Australia Austria Azerbaijan Burundi ... Uruguay United States Uzbekistan Venezuela Vietnam Kosovo Yemen, Rep. South Africa Zambia Zimbabwe
1960 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.590973e+09 2.420469e+08 4.597601e+08 9.155910e+07 1.059660e+09 3.324587e+07 ... 4.804815e+08 4.538000e+10 1.238692e+08 2.343577e+08 2.180475e+09 4.416306e+07 1.042874e+09 6.999997e+07 1.824264e+08 2.694134e+08
1961 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.590973e+09 2.420469e+08 4.709601e+08 9.102985e+07 1.059660e+09 3.324587e+07 ... 4.804815e+08 4.780800e+10 1.238692e+08 1.146327e+08 2.180475e+09 4.416306e+07 1.042874e+09 1.137500e+08 1.824264e+08 2.694134e+08
1962 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 3.051624e+08 2.420469e+08 4.894401e+08 1.000270e+08 1.059660e+09 8.420000e+06 ... 4.804815e+08 5.238100e+10 1.238692e+08 2.039007e+08 2.180475e+09 4.416306e+07 1.042874e+09 1.861999e+08 1.824264e+08 2.694134e+08
1963 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.422198e+08 2.420469e+08 5.532801e+08 1.259599e+08 1.059660e+09 1.012000e+06 ... 4.804815e+08 5.229500e+10 1.238692e+08 2.453973e+08 2.180475e+09 4.416306e+07 1.042874e+09 1.889999e+08 1.824264e+08 2.694134e+08
1964 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.457405e+08 2.420469e+08 6.557601e+08 1.645947e+08 1.059660e+09 1.162000e+06 ... 4.804815e+08 5.121300e+10 1.238692e+08 2.004598e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.715999e+08 1.824264e+08 2.694134e+08
1965 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.524076e+08 2.420469e+08 7.873601e+08 1.428957e+08 1.059660e+09 2.153481e+06 ... 4.804815e+08 5.182700e+10 1.238692e+08 2.272727e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.894499e+08 1.824264e+08 1.560000e+07
1966 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.792254e+08 2.420469e+08 9.867202e+08 1.677701e+08 1.059660e+09 2.286857e+06 ... 4.804815e+08 6.357200e+10 1.238692e+08 2.386364e+08 2.180475e+09 4.416306e+07 1.042874e+09 3.244499e+08 1.824264e+08 1.695000e+07
1967 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.519307e+08 2.420469e+08 1.197840e+09 1.767673e+08 1.059660e+09 2.376000e+06 ... 4.804815e+08 7.544800e+10 1.238692e+08 2.704545e+08 2.180475e+09 4.416306e+07 1.042874e+09 3.730999e+08 1.824264e+08 1.900000e+07
1968 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 3.371429e+08 2.420469e+08 1.321600e+09 1.820597e+08 1.059660e+09 2.590857e+06 ... 4.804815e+08 8.073200e+10 1.238692e+08 2.727273e+08 2.180475e+09 4.416306e+07 1.042874e+09 3.996998e+08 1.824264e+08 3.060000e+07
1969 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 4.428571e+08 2.420469e+08 1.314880e+09 1.931738e+08 1.059660e+09 3.337143e+06 ... 4.804815e+08 8.144300e+10 1.238692e+08 2.636364e+08 2.180475e+09 4.416306e+07 1.042874e+09 4.255998e+08 1.824264e+08 4.235000e+07
1970 2.939586e+06 1.710054e+09 1.131249e+08 1.060689e+10 4.457139e+08 2.420469e+08 1.277360e+09 1.995247e+08 1.059660e+09 3.324587e+07 ... 4.804815e+08 7.984600e+10 1.238692e+08 2.727273e+08 2.180475e+09 4.416306e+07 1.042874e+09 4.178998e+08 1.824264e+08 4.595000e+07
1971 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 5.197195e+08 2.420469e+08 1.331755e+09 2.092776e+08 1.059660e+09 2.628571e+06 ... 4.804815e+08 7.486200e+10 1.238692e+08 3.522727e+08 2.180475e+09 4.416306e+07 1.042874e+09 4.858665e+08 1.824264e+08 4.985000e+07
1972 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 7.660000e+08 2.420469e+08 1.484444e+09 2.494255e+08 1.059660e+09 3.600000e+06 ... 5.142928e+07 7.763900e+10 1.238692e+08 4.046512e+08 2.180475e+09 4.416306e+07 1.042874e+09 4.923865e+08 1.824264e+08 5.845000e+07
1973 3.341272e+06 1.710054e+09 1.131249e+08 1.060689e+10 1.294000e+09 2.420469e+08 1.855729e+09 3.288988e+08 1.059660e+09 5.923068e+06 ... 1.124656e+08 7.835800e+10 1.238692e+08 4.209302e+08 2.180475e+09 4.416306e+07 1.042874e+09 7.529263e+08 1.824264e+08 8.690000e+07
1974 3.581366e+06 1.710054e+09 1.131249e+08 1.060689e+10 1.626000e+09 2.420469e+08 2.127275e+09 4.225435e+08 1.059660e+09 7.682540e+06 ... 1.875575e+08 8.590600e+10 1.238692e+08 6.023256e+08 2.180475e+09 4.416306e+07 1.042874e+09 1.102318e+09 1.824264e+08 1.185500e+08
1975 4.203665e+06 1.710054e+09 1.131249e+08 1.060689e+10 7.983595e+08 2.420469e+08 2.268708e+09 5.467244e+08 1.059660e+09 8.533333e+06 ... 1.565414e+08 8.840000e+10 1.238692e+08 7.116279e+08 2.180475e+09 4.416306e+07 1.042874e+09 1.431695e+09 1.824264e+08 1.486000e+08
1976 5.393251e+06 1.710054e+09 1.131249e+08 1.060689e+10 2.050249e+09 2.420469e+08 2.441084e+09 5.814087e+08 1.059660e+09 9.971014e+06 ... 1.332324e+08 9.101300e+10 1.238692e+08 5.930233e+08 2.180475e+09 4.416306e+07 1.042874e+09 1.677275e+09 1.824264e+08 1.998000e+08
1977 6.127288e+06 1.710054e+09 1.131249e+08 1.060689e+10 2.058224e+09 2.420469e+08 2.500485e+09 6.868932e+08 1.059660e+09 1.395556e+07 ... 1.605451e+08 1.010000e+11 1.238692e+08 7.488372e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.073738e+09 1.824264e+08 2.853500e+08
1978 1.542668e+08 3.432716e+08 1.131249e+08 1.060689e+10 3.103990e+09 2.420469e+08 2.816316e+09 8.774507e+08 1.059660e+09 1.703333e+07 ... 1.859437e+08 1.090000e+11 1.238692e+08 8.279070e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.067988e+09 1.824264e+08 3.477500e+08
1979 1.542668e+08 5.047129e+08 1.131249e+08 1.060689e+10 5.057063e+09 2.420469e+08 3.100685e+09 1.049973e+09 1.059660e+09 2.000000e+07 ... 2.793962e+08 1.220000e+11 1.238692e+08 9.255814e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.160867e+09 1.824264e+08 4.411500e+08
1980 1.542668e+08 4.973594e+08 1.131249e+08 1.060689e+10 6.477389e+09 2.420469e+08 3.657867e+09 1.152896e+09 1.059660e+09 2.776333e+07 ... 4.772665e+08 1.380000e+11 1.238692e+08 1.002326e+09 2.180475e+09 4.416306e+07 1.042874e+09 2.661671e+09 1.824264e+08 4.427500e+08
1981 1.542668e+08 6.188916e+08 1.131249e+08 1.060689e+10 5.882767e+09 2.420469e+08 4.323644e+09 9.693723e+08 1.059660e+09 2.999556e+07 ... 7.096995e+08 1.700000e+11 1.238692e+08 1.009302e+09 2.180475e+09 4.416306e+07 1.042874e+09 3.011980e+09 1.824264e+08 3.897000e+08
1982 1.542668e+08 6.684939e+08 1.131249e+08 1.060689e+10 2.279873e+09 2.420469e+08 4.459545e+09 9.953700e+08 1.059660e+09 3.666556e+07 ... 5.991352e+08 2.140000e+11 1.238692e+08 1.523256e+09 2.180475e+09 4.416306e+07 1.042874e+09 2.744700e+09 1.824264e+08 4.374500e+08
1983 1.542668e+08 7.786283e+08 1.131249e+08 1.060689e+10 2.848053e+09 2.420469e+08 4.511671e+09 9.919951e+08 1.059660e+09 3.436964e+07 ... 2.746118e+08 2.140000e+11 1.238692e+08 2.006977e+09 2.180475e+09 4.416306e+07 1.042874e+09 3.052688e+09 1.824264e+08 4.317500e+08
1984 1.542668e+08 1.066248e+09 1.131249e+08 1.060689e+10 2.527750e+09 2.420469e+08 4.925319e+09 9.497153e+08 1.059660e+09 2.993843e+07 ... 2.218513e+08 2.310000e+11 1.238692e+08 1.325415e+09 2.180475e+09 4.416306e+07 1.042874e+09 2.770152e+09 8.162410e+07 3.606500e+08
1985 1.542668e+08 1.146467e+09 1.131249e+08 1.060689e+10 2.027221e+09 2.420469e+08 4.386859e+09 1.036872e+09 1.059660e+09 3.222030e+07 ... 2.036459e+08 2.580000e+11 1.238692e+08 8.200000e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.117406e+09 5.319081e+07 3.093000e+08
1986 1.542668e+08 1.156494e+09 1.131249e+08 1.060689e+10 2.449546e+09 2.420469e+08 4.606710e+09 1.475426e+09 1.059660e+09 3.460774e+07 ... 2.423498e+08 2.810000e+11 1.238692e+08 1.004536e+09 2.180475e+09 4.416306e+07 1.042874e+09 2.497888e+09 6.162972e+07 3.422000e+08
1987 1.542668e+08 1.487399e+09 1.131249e+08 1.060689e+10 2.485660e+09 2.420469e+08 5.057136e+09 1.737113e+09 1.059660e+09 3.078486e+07 ... 2.239249e+08 2.880000e+11 1.238692e+08 7.655172e+08 1.315598e+09 4.416306e+07 1.042874e+09 3.595969e+09 6.691549e+07 3.926000e+08
1988 1.542668e+08 1.469383e+09 1.131249e+08 1.060689e+10 2.696342e+09 2.420469e+08 5.836348e+09 1.713955e+09 1.059660e+09 3.425549e+07 ... 2.599670e+08 2.930000e+11 1.238692e+08 1.096552e+09 1.305815e+09 4.416306e+07 1.042874e+09 4.263087e+09 8.674066e+07 4.070500e+08
1989 1.542668e+08 1.948559e+09 1.131249e+08 1.060689e+10 1.440922e+09 2.420469e+08 6.300016e+09 1.623488e+09 1.059660e+09 3.790328e+07 ... 2.978212e+08 3.040000e+11 1.238692e+08 1.196252e+09 4.585625e+08 4.416306e+07 1.042874e+09 4.181886e+09 1.675873e+08 4.086000e+08
1990 1.542668e+08 1.751153e+09 1.131249e+08 1.060689e+10 2.050908e+09 2.420469e+08 6.704214e+09 1.972702e+09 1.059660e+09 3.960235e+07 ... 3.283511e+08 3.060000e+11 1.238692e+08 7.378705e+08 5.119701e+08 4.416306e+07 8.070707e+08 4.364458e+09 1.393240e+08 4.163000e+08
1991 1.542668e+08 1.031248e+09 1.131249e+08 1.060689e+10 2.858779e+09 2.420469e+08 7.023509e+09 1.994056e+09 1.059660e+09 4.275176e+07 ... 2.686280e+08 2.800000e+11 1.238692e+08 9.837220e+08 4.276178e+08 4.416306e+07 1.028218e+09 3.874415e+09 8.624731e+07 3.760500e+08
1992 1.542668e+08 7.941388e+08 3.155966e+07 1.060689e+10 3.254455e+09 2.420469e+08 6.882092e+09 2.139925e+09 1.107011e+07 3.898648e+07 ... 3.669652e+08 3.050000e+11 1.238692e+08 9.929325e+08 3.329703e+08 4.416306e+07 1.306900e+09 3.677406e+09 9.775628e+07 2.963500e+08
1993 1.542668e+08 1.774398e+09 3.928984e+07 1.060689e+10 3.368550e+09 9.829764e+06 6.733829e+09 2.115115e+09 7.751938e+07 3.626740e+07 ... 4.189196e+08 2.980000e+11 1.238692e+08 1.287955e+09 2.977164e+08 4.416306e+07 1.535458e+09 3.254313e+09 5.112829e+07 2.498000e+08
1994 1.542668e+08 5.949912e+08 4.964950e+07 1.060689e+10 3.754725e+09 2.420469e+08 7.459697e+09 2.227561e+09 4.394275e+07 4.190975e+07 ... 4.504433e+08 2.880000e+11 8.692982e+07 9.396832e+08 4.313450e+08 4.416306e+07 2.353269e+09 3.478582e+09 6.286947e+07 2.479000e+08
1995 1.542668e+08 2.338437e+08 5.090752e+07 1.060689e+10 3.801950e+09 5.222858e+07 7.665878e+09 2.557834e+09 6.615997e+07 4.210893e+07 ... 5.238620e+08 2.790000e+11 1.126784e+08 1.198810e+09 2.180475e+09 4.416306e+07 8.058924e+08 3.292447e+09 5.526554e+07 2.629000e+08
1996 1.542668e+08 1.597419e+08 4.571336e+07 1.060689e+10 3.379139e+09 5.241027e+07 8.202777e+09 2.457903e+09 7.160684e+07 5.089398e+07 ... 5.756520e+08 2.710000e+11 1.722115e+08 7.331976e+08 2.180475e+09 4.416306e+07 4.160086e+08 2.591787e+09 3.783591e+07 2.916500e+08
1997 1.542668e+08 4.567805e+08 2.982549e+07 3.335767e+09 3.340670e+09 6.406212e+07 7.936885e+09 2.164802e+09 9.208669e+07 6.187012e+07 ... 5.752063e+08 2.760000e+11 2.177472e+08 1.541034e+09 2.180475e+09 4.416306e+07 3.970730e+08 2.414138e+09 4.336250e+07 3.114000e+08
1998 1.542668e+08 1.702783e+08 3.363805e+07 4.010347e+09 3.398699e+09 6.675757e+07 7.107543e+09 2.159796e+09 1.072629e+08 5.873604e+07 ... 5.732484e+08 2.740000e+11 1.238692e+08 1.450964e+09 2.180475e+09 4.416306e+07 3.845027e+08 1.905656e+09 1.824264e+08 3.060000e+08
1999 1.542668e+08 1.066589e+09 4.278421e+07 4.233084e+09 3.461731e+09 6.823415e+07 7.770251e+09 2.124380e+09 1.202622e+08 5.057119e+07 ... 5.742859e+08 2.810000e+11 2.500717e+08 1.408065e+09 2.180475e+09 4.416306e+07 3.952530e+08 1.738037e+09 5.611343e+07 2.634000e+08
2000 1.542668e+08 5.836213e+08 4.536250e+07 5.875834e+09 3.266633e+09 6.805214e+07 7.273760e+09 1.925557e+09 1.195757e+08 4.232155e+07 ... 5.559688e+08 3.020000e+11 1.153754e+08 1.788322e+09 2.180475e+09 4.416306e+07 4.736640e+08 1.891725e+09 1.824264e+08 3.463000e+08
2001 1.542668e+08 4.042991e+08 5.323205e+07 5.797958e+09 3.183592e+09 6.624763e+07 7.043146e+09 1.788798e+09 1.319637e+08 5.323037e+07 ... 5.230083e+08 3.130000e+11 5.976061e+07 1.911400e+09 2.180475e+09 4.416306e+07 5.401015e+08 1.802262e+09 1.824264e+08 2.867000e+08
2002 1.542668e+08 4.386862e+08 5.864935e+07 5.354118e+09 1.114172e+09 6.410641e+07 7.946766e+09 1.881747e+09 1.398941e+08 4.491007e+07 ... 3.442631e+08 3.570000e+11 4.591443e+07 1.071364e+09 2.180475e+09 4.416306e+07 7.373665e+08 1.766083e+09 1.824264e+08 6.770000e+08
2003 1.542668e+08 6.700212e+08 7.614288e+07 5.834717e+09 1.374874e+09 7.658800e+07 9.926649e+09 2.381963e+09 1.765522e+08 4.341320e+07 ... 2.695268e+08 4.150000e+11 5.413370e+07 9.878902e+08 8.419302e+08 4.416306e+07 8.073132e+08 2.574176e+09 1.824264e+08 1.948000e+08
2004 1.251116e+08 8.175336e+08 1.009224e+08 6.816882e+09 1.465809e+09 9.807049e+07 1.199522e+10 2.679282e+09 2.282496e+08 4.487238e+07 ... 2.793020e+08 4.650000e+11 1.238692e+08 1.448716e+09 9.150895e+08 4.416306e+07 7.354851e+08 3.099065e+09 9.834940e+07 2.561000e+08
2005 1.227272e+08 1.365055e+09 1.101409e+08 6.604221e+09 1.699579e+09 1.407381e+08 1.323780e+10 2.686166e+09 3.045215e+08 4.955713e+07 ... 3.473238e+08 5.030000e+11 1.238692e+08 2.665391e+09 1.026427e+09 4.416306e+07 8.156275e+08 3.566964e+09 1.395094e+08 1.314000e+08
2006 1.313462e+08 1.970309e+09 1.409839e+08 7.165419e+09 1.847553e+09 1.881891e+08 1.423978e+10 2.640185e+09 7.171119e+08 4.471750e+07 ... 3.927987e+08 5.280000e+11 1.238692e+08 3.630088e+09 1.286529e+09 4.416306e+07 8.221305e+08 3.506140e+09 2.058522e+08 1.617000e+08
2007 2.195802e+08 2.032433e+09 1.948403e+08 8.460994e+09 2.296448e+09 2.801087e+08 1.718644e+10 3.499818e+09 9.465998e+08 4.630871e+07 ... 4.160453e+08 5.570000e+11 1.238692e+08 4.351560e+09 1.784217e+09 4.416306e+07 1.050499e+09 3.525684e+09 2.322787e+08 2.694134e+08
2008 2.405326e+08 3.163591e+09 2.556780e+08 1.157168e+10 2.788980e+09 3.959944e+08 1.863309e+10 3.746732e+09 1.607799e+09 4.385632e+07 ... 5.677039e+08 6.210000e+11 1.238692e+08 5.660456e+09 2.137626e+09 9.272348e+05 1.196412e+09 3.285925e+09 2.780551e+08 2.694134e+08
2009 2.518695e+08 3.311193e+09 1.827369e+08 1.383635e+10 2.981852e+09 3.594993e+08 1.896014e+10 3.334755e+09 1.472910e+09 3.324587e+07 ... 5.770560e+08 6.690000e+11 1.238692e+08 4.055380e+09 2.401451e+09 2.722709e+07 1.420775e+09 3.592688e+09 2.209623e+08 2.694134e+08
2010 2.981469e+08 3.500795e+09 1.858932e+08 1.750470e+10 3.475348e+09 3.950115e+08 2.321769e+10 3.218351e+09 1.476609e+09 3.324587e+07 ... 7.556595e+08 6.980000e+11 1.238692e+08 3.991195e+09 2.672286e+09 3.857812e+07 1.448153e+09 4.188168e+09 2.801878e+08 9.829300e+07
2011 3.258070e+08 3.639496e+09 1.970068e+08 1.918176e+10 4.051930e+09 3.908714e+08 2.659720e+10 3.409721e+09 3.080085e+09 3.324587e+07 ... 8.248335e+08 7.110000e+11 1.238692e+08 3.577532e+09 2.686521e+09 5.096886e+07 1.612254e+09 4.594154e+09 3.091138e+08 1.984380e+08
2012 2.385834e+08 4.144635e+09 1.832047e+08 1.902410e+10 4.563218e+09 3.805717e+08 2.621658e+10 3.187227e+09 3.246123e+09 5.896666e+07 ... 9.246403e+08 6.850000e+11 1.238692e+08 5.114847e+09 3.360860e+09 4.339040e+07 1.618840e+09 4.489590e+09 3.463014e+08 3.182720e+08
2013 2.171941e+08 6.090752e+09 1.800155e+08 2.356106e+10 5.137974e+09 4.445519e+08 2.482526e+10 3.229066e+09 3.367574e+09 6.085950e+07 ... 1.045084e+09 6.400000e+11 1.238692e+08 6.199698e+09 3.727249e+09 4.859768e+07 1.648751e+09 4.118208e+09 3.813458e+08 3.567000e+08
2014 2.682271e+08 6.841864e+09 1.781204e+08 2.275507e+10 4.979443e+09 4.578070e+08 2.578371e+10 3.305159e+09 3.427180e+09 6.217729e+07 ... 1.034501e+09 6.100000e+11 1.238692e+08 1.554727e+09 4.255722e+09 5.357579e+07 1.714831e+09 3.892469e+09 4.436044e+08 3.681000e+08
2015 1.995186e+08 3.608299e+09 1.323507e+08 1.060689e+10 5.482617e+09 4.473798e+08 2.404557e+10 2.665410e+09 2.943397e+09 6.616458e+07 ... 9.699068e+08 5.960000e+11 1.238692e+08 3.205392e+08 4.562633e+09 4.998416e+07 1.042874e+09 3.488868e+09 3.724476e+08 3.766770e+08
2016 1.858783e+08 2.764055e+09 1.308532e+08 1.060689e+10 4.509648e+09 4.313962e+08 2.638295e+10 2.885947e+09 1.396969e+09 6.646284e+07 ... 9.882236e+08 6.000000e+11 1.238692e+08 2.181549e+08 5.017402e+09 5.193762e+07 1.042874e+09 3.169756e+09 2.995048e+08 3.580650e+08
2017 1.914071e+08 3.062873e+09 1.443827e+08 1.060689e+10 5.459644e+09 4.436104e+08 2.769111e+10 3.138359e+09 1.528860e+09 6.390868e+07 ... 1.165710e+09 6.060000e+11 1.238692e+08 4.648218e+08 5.073854e+09 5.726263e+07 1.042874e+09 3.638937e+09 3.396645e+08 3.405220e+08
2018 1.980863e+08 1.983614e+09 1.804887e+08 1.060689e+10 4.144992e+09 6.088546e+08 2.671183e+10 3.367460e+09 1.708941e+09 6.543660e+07 ... 1.168131e+09 6.490000e+11 1.238692e+08 1.382204e+09 5.500000e+09 6.334407e+07 1.042874e+09 3.639879e+09 3.780254e+08 4.203640e+08

59 rows × 166 columns

In [10]:
five_years_countries = Countires.iloc[::5, :]
five_years_countries
Out[10]:
Year Afghanistan Angola Albania United Arab Emirates Argentina Armenia Australia Austria Azerbaijan Burundi ... Uruguay United States Uzbekistan Venezuela Vietnam Kosovo Yemen, Rep. South Africa Zambia Zimbabwe
1960 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.590973e+09 2.420469e+08 4.597601e+08 9.155910e+07 1.059660e+09 3.324587e+07 ... 4.804815e+08 4.538000e+10 1.238692e+08 2.343577e+08 2.180475e+09 4.416306e+07 1.042874e+09 6.999997e+07 1.824264e+08 2.694134e+08
1965 1.542668e+08 1.710054e+09 1.131249e+08 1.060689e+10 2.524076e+08 2.420469e+08 7.873601e+08 1.428957e+08 1.059660e+09 2.153481e+06 ... 4.804815e+08 5.182700e+10 1.238692e+08 2.272727e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.894499e+08 1.824264e+08 1.560000e+07
1970 2.939586e+06 1.710054e+09 1.131249e+08 1.060689e+10 4.457139e+08 2.420469e+08 1.277360e+09 1.995247e+08 1.059660e+09 3.324587e+07 ... 4.804815e+08 7.984600e+10 1.238692e+08 2.727273e+08 2.180475e+09 4.416306e+07 1.042874e+09 4.178998e+08 1.824264e+08 4.595000e+07
1975 4.203665e+06 1.710054e+09 1.131249e+08 1.060689e+10 7.983595e+08 2.420469e+08 2.268708e+09 5.467244e+08 1.059660e+09 8.533333e+06 ... 1.565414e+08 8.840000e+10 1.238692e+08 7.116279e+08 2.180475e+09 4.416306e+07 1.042874e+09 1.431695e+09 1.824264e+08 1.486000e+08
1980 1.542668e+08 4.973594e+08 1.131249e+08 1.060689e+10 6.477389e+09 2.420469e+08 3.657867e+09 1.152896e+09 1.059660e+09 2.776333e+07 ... 4.772665e+08 1.380000e+11 1.238692e+08 1.002326e+09 2.180475e+09 4.416306e+07 1.042874e+09 2.661671e+09 1.824264e+08 4.427500e+08
1985 1.542668e+08 1.146467e+09 1.131249e+08 1.060689e+10 2.027221e+09 2.420469e+08 4.386859e+09 1.036872e+09 1.059660e+09 3.222030e+07 ... 2.036459e+08 2.580000e+11 1.238692e+08 8.200000e+08 2.180475e+09 4.416306e+07 1.042874e+09 2.117406e+09 5.319081e+07 3.093000e+08
1990 1.542668e+08 1.751153e+09 1.131249e+08 1.060689e+10 2.050908e+09 2.420469e+08 6.704214e+09 1.972702e+09 1.059660e+09 3.960235e+07 ... 3.283511e+08 3.060000e+11 1.238692e+08 7.378705e+08 5.119701e+08 4.416306e+07 8.070707e+08 4.364458e+09 1.393240e+08 4.163000e+08
1995 1.542668e+08 2.338437e+08 5.090752e+07 1.060689e+10 3.801950e+09 5.222858e+07 7.665878e+09 2.557834e+09 6.615997e+07 4.210893e+07 ... 5.238620e+08 2.790000e+11 1.126784e+08 1.198810e+09 2.180475e+09 4.416306e+07 8.058924e+08 3.292447e+09 5.526554e+07 2.629000e+08
2000 1.542668e+08 5.836213e+08 4.536250e+07 5.875834e+09 3.266633e+09 6.805214e+07 7.273760e+09 1.925557e+09 1.195757e+08 4.232155e+07 ... 5.559688e+08 3.020000e+11 1.153754e+08 1.788322e+09 2.180475e+09 4.416306e+07 4.736640e+08 1.891725e+09 1.824264e+08 3.463000e+08
2005 1.227272e+08 1.365055e+09 1.101409e+08 6.604221e+09 1.699579e+09 1.407381e+08 1.323780e+10 2.686166e+09 3.045215e+08 4.955713e+07 ... 3.473238e+08 5.030000e+11 1.238692e+08 2.665391e+09 1.026427e+09 4.416306e+07 8.156275e+08 3.566964e+09 1.395094e+08 1.314000e+08
2010 2.981469e+08 3.500795e+09 1.858932e+08 1.750470e+10 3.475348e+09 3.950115e+08 2.321769e+10 3.218351e+09 1.476609e+09 3.324587e+07 ... 7.556595e+08 6.980000e+11 1.238692e+08 3.991195e+09 2.672286e+09 3.857812e+07 1.448153e+09 4.188168e+09 2.801878e+08 9.829300e+07
2015 1.995186e+08 3.608299e+09 1.323507e+08 1.060689e+10 5.482617e+09 4.473798e+08 2.404557e+10 2.665410e+09 2.943397e+09 6.616458e+07 ... 9.699068e+08 5.960000e+11 1.238692e+08 3.205392e+08 4.562633e+09 4.998416e+07 1.042874e+09 3.488868e+09 3.724476e+08 3.766770e+08

12 rows × 166 columns

In [11]:
five_years_countries.index 
Out[11]:
Index(['1960', '1965', '1970', '1975', '1980', '1985', '1990', '1995', '2000',
       '2005', '2010', '2015'],
      dtype='object')
In [12]:
five_years_countries['United States']
Out[12]:
1960    4.538000e+10
1965    5.182700e+10
1970    7.984600e+10
1975    8.840000e+10
1980    1.380000e+11
1985    2.580000e+11
1990    3.060000e+11
1995    2.790000e+11
2000    3.020000e+11
2005    5.030000e+11
2010    6.980000e+11
2015    5.960000e+11
Name: United States, dtype: float64
In [13]:
USA = five_years_countries['United States']
In [14]:
plt.figure(figsize=(20,10))
plt.plot(five_years_countries['United States'])
plt.title('Millitary Spending: United States')
plt.xlabel('years')
plt.ylabel('Amount of money')
plt.show()

BRIC Countires And U.S.

In [15]:
Countires.head(100)
Last_twenty_years = Countires[40:]
In [16]:
Last_twenty_years
Out[16]:
Year Afghanistan Angola Albania United Arab Emirates Argentina Armenia Australia Austria Azerbaijan Burundi ... Uruguay United States Uzbekistan Venezuela Vietnam Kosovo Yemen, Rep. South Africa Zambia Zimbabwe
2000 1.542668e+08 5.836213e+08 4.536250e+07 5.875834e+09 3.266633e+09 6.805214e+07 7.273760e+09 1.925557e+09 1.195757e+08 4.232155e+07 ... 5.559688e+08 3.020000e+11 1.153754e+08 1.788322e+09 2.180475e+09 4.416306e+07 4.736640e+08 1.891725e+09 1.824264e+08 3.463000e+08
2001 1.542668e+08 4.042991e+08 5.323205e+07 5.797958e+09 3.183592e+09 6.624763e+07 7.043146e+09 1.788798e+09 1.319637e+08 5.323037e+07 ... 5.230083e+08 3.130000e+11 5.976061e+07 1.911400e+09 2.180475e+09 4.416306e+07 5.401015e+08 1.802262e+09 1.824264e+08 2.867000e+08
2002 1.542668e+08 4.386862e+08 5.864935e+07 5.354118e+09 1.114172e+09 6.410641e+07 7.946766e+09 1.881747e+09 1.398941e+08 4.491007e+07 ... 3.442631e+08 3.570000e+11 4.591443e+07 1.071364e+09 2.180475e+09 4.416306e+07 7.373665e+08 1.766083e+09 1.824264e+08 6.770000e+08
2003 1.542668e+08 6.700212e+08 7.614288e+07 5.834717e+09 1.374874e+09 7.658800e+07 9.926649e+09 2.381963e+09 1.765522e+08 4.341320e+07 ... 2.695268e+08 4.150000e+11 5.413370e+07 9.878902e+08 8.419302e+08 4.416306e+07 8.073132e+08 2.574176e+09 1.824264e+08 1.948000e+08
2004 1.251116e+08 8.175336e+08 1.009224e+08 6.816882e+09 1.465809e+09 9.807049e+07 1.199522e+10 2.679282e+09 2.282496e+08 4.487238e+07 ... 2.793020e+08 4.650000e+11 1.238692e+08 1.448716e+09 9.150895e+08 4.416306e+07 7.354851e+08 3.099065e+09 9.834940e+07 2.561000e+08
2005 1.227272e+08 1.365055e+09 1.101409e+08 6.604221e+09 1.699579e+09 1.407381e+08 1.323780e+10 2.686166e+09 3.045215e+08 4.955713e+07 ... 3.473238e+08 5.030000e+11 1.238692e+08 2.665391e+09 1.026427e+09 4.416306e+07 8.156275e+08 3.566964e+09 1.395094e+08 1.314000e+08
2006 1.313462e+08 1.970309e+09 1.409839e+08 7.165419e+09 1.847553e+09 1.881891e+08 1.423978e+10 2.640185e+09 7.171119e+08 4.471750e+07 ... 3.927987e+08 5.280000e+11 1.238692e+08 3.630088e+09 1.286529e+09 4.416306e+07 8.221305e+08 3.506140e+09 2.058522e+08 1.617000e+08
2007 2.195802e+08 2.032433e+09 1.948403e+08 8.460994e+09 2.296448e+09 2.801087e+08 1.718644e+10 3.499818e+09 9.465998e+08 4.630871e+07 ... 4.160453e+08 5.570000e+11 1.238692e+08 4.351560e+09 1.784217e+09 4.416306e+07 1.050499e+09 3.525684e+09 2.322787e+08 2.694134e+08
2008 2.405326e+08 3.163591e+09 2.556780e+08 1.157168e+10 2.788980e+09 3.959944e+08 1.863309e+10 3.746732e+09 1.607799e+09 4.385632e+07 ... 5.677039e+08 6.210000e+11 1.238692e+08 5.660456e+09 2.137626e+09 9.272348e+05 1.196412e+09 3.285925e+09 2.780551e+08 2.694134e+08
2009 2.518695e+08 3.311193e+09 1.827369e+08 1.383635e+10 2.981852e+09 3.594993e+08 1.896014e+10 3.334755e+09 1.472910e+09 3.324587e+07 ... 5.770560e+08 6.690000e+11 1.238692e+08 4.055380e+09 2.401451e+09 2.722709e+07 1.420775e+09 3.592688e+09 2.209623e+08 2.694134e+08
2010 2.981469e+08 3.500795e+09 1.858932e+08 1.750470e+10 3.475348e+09 3.950115e+08 2.321769e+10 3.218351e+09 1.476609e+09 3.324587e+07 ... 7.556595e+08 6.980000e+11 1.238692e+08 3.991195e+09 2.672286e+09 3.857812e+07 1.448153e+09 4.188168e+09 2.801878e+08 9.829300e+07
2011 3.258070e+08 3.639496e+09 1.970068e+08 1.918176e+10 4.051930e+09 3.908714e+08 2.659720e+10 3.409721e+09 3.080085e+09 3.324587e+07 ... 8.248335e+08 7.110000e+11 1.238692e+08 3.577532e+09 2.686521e+09 5.096886e+07 1.612254e+09 4.594154e+09 3.091138e+08 1.984380e+08
2012 2.385834e+08 4.144635e+09 1.832047e+08 1.902410e+10 4.563218e+09 3.805717e+08 2.621658e+10 3.187227e+09 3.246123e+09 5.896666e+07 ... 9.246403e+08 6.850000e+11 1.238692e+08 5.114847e+09 3.360860e+09 4.339040e+07 1.618840e+09 4.489590e+09 3.463014e+08 3.182720e+08
2013 2.171941e+08 6.090752e+09 1.800155e+08 2.356106e+10 5.137974e+09 4.445519e+08 2.482526e+10 3.229066e+09 3.367574e+09 6.085950e+07 ... 1.045084e+09 6.400000e+11 1.238692e+08 6.199698e+09 3.727249e+09 4.859768e+07 1.648751e+09 4.118208e+09 3.813458e+08 3.567000e+08
2014 2.682271e+08 6.841864e+09 1.781204e+08 2.275507e+10 4.979443e+09 4.578070e+08 2.578371e+10 3.305159e+09 3.427180e+09 6.217729e+07 ... 1.034501e+09 6.100000e+11 1.238692e+08 1.554727e+09 4.255722e+09 5.357579e+07 1.714831e+09 3.892469e+09 4.436044e+08 3.681000e+08
2015 1.995186e+08 3.608299e+09 1.323507e+08 1.060689e+10 5.482617e+09 4.473798e+08 2.404557e+10 2.665410e+09 2.943397e+09 6.616458e+07 ... 9.699068e+08 5.960000e+11 1.238692e+08 3.205392e+08 4.562633e+09 4.998416e+07 1.042874e+09 3.488868e+09 3.724476e+08 3.766770e+08
2016 1.858783e+08 2.764055e+09 1.308532e+08 1.060689e+10 4.509648e+09 4.313962e+08 2.638295e+10 2.885947e+09 1.396969e+09 6.646284e+07 ... 9.882236e+08 6.000000e+11 1.238692e+08 2.181549e+08 5.017402e+09 5.193762e+07 1.042874e+09 3.169756e+09 2.995048e+08 3.580650e+08
2017 1.914071e+08 3.062873e+09 1.443827e+08 1.060689e+10 5.459644e+09 4.436104e+08 2.769111e+10 3.138359e+09 1.528860e+09 6.390868e+07 ... 1.165710e+09 6.060000e+11 1.238692e+08 4.648218e+08 5.073854e+09 5.726263e+07 1.042874e+09 3.638937e+09 3.396645e+08 3.405220e+08
2018 1.980863e+08 1.983614e+09 1.804887e+08 1.060689e+10 4.144992e+09 6.088546e+08 2.671183e+10 3.367460e+09 1.708941e+09 6.543660e+07 ... 1.168131e+09 6.490000e+11 1.238692e+08 1.382204e+09 5.500000e+09 6.334407e+07 1.042874e+09 3.639879e+09 3.780254e+08 4.203640e+08

19 rows × 166 columns

In [20]:
BZL = Last_twenty_years['Brazil']
RUS = Last_twenty_years['Russian Federation']
IND = Last_twenty_years['India']
CHN = Last_twenty_years['China']
USA = Last_twenty_years['United States']
In [21]:
USA = Last_twenty_years['United States']
In [22]:
USA
Out[22]:
2000    3.020000e+11
2001    3.130000e+11
2002    3.570000e+11
2003    4.150000e+11
2004    4.650000e+11
2005    5.030000e+11
2006    5.280000e+11
2007    5.570000e+11
2008    6.210000e+11
2009    6.690000e+11
2010    6.980000e+11
2011    7.110000e+11
2012    6.850000e+11
2013    6.400000e+11
2014    6.100000e+11
2015    5.960000e+11
2016    6.000000e+11
2017    6.060000e+11
2018    6.490000e+11
Name: United States, dtype: float64
In [27]:
# BZL + RUS + IND + CHN
BRIC = BZL + RUS + IND + CHN
In [28]:
BRIC
Out[28]:
2000    5.778952e+10
2001    6.508941e+10
2002    7.049579e+10
2003    7.682694e+10
2004    9.132680e+10
2005    1.099168e+11
2006    1.302121e+11
2007    1.602871e+11
2008    2.000012e+11
2009    2.219031e+11
2010    2.548136e+11
2011    2.948075e+11
2012    3.196733e+11
2013    3.486312e+11
2014    3.692702e+11
2015    3.563319e+11
2016    3.661077e+11
2017    3.883698e+11
2018    4.056643e+11
dtype: float64
In [22]:
plt.figure(figsize=(20,10))
USA.plot(linestyle='-', color='blue')
BZL.plot(linestyle='-', color='green')
CHN.plot(linestyle='-', color='pink')
RUS.plot(linestyle='-', color='red')
IND.plot(linestyle='-', color='orange')
plt.legend(['USA', 'Brazil', 'China', 'Russia', 'India'])
plt.title('Millitary Spending: BRIC Countires And U.S.')
plt.xlabel('years')
plt.ylabel('Amount of money')
plt.show()

Military Spending: BRIC Countries And U.S

In this visualization, I looked at the military spending Of the United States, Brazil, China, Russia, and India over the course of 2000-2018. Amongst all the Bric Countries the U.S. accounts for the highest military spending across the globe.

In [30]:
plt.figure(figsize=(20,10))
USA.plot(linestyle='-', color='blue')
BRIC.plot(linestyle='-', color='Black')
plt.legend(['USA', 'BRIC '])
plt.title('Millitary Spending: BRIC Combined Countires And U.S.')
plt.xlabel('years')
plt.ylabel('Amount of money')
plt.show()

Military Spending: BRIC Combined Countries And U.S.

In a Second Data Visualization, I combine all Bric Countries together and Compared it to U.S Military spending. Although it still does not surpass U.S military spending it is Somewhat Closer

In [31]:
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.model_selection import train_test_split
In [32]:
Year = []
for i in Last_twenty_years.index:
    i = int(i)
    Year.append(i)
In [36]:
x = np.unique(Year).reshape(-1,1) 
y = BRIC

x_train, x_test, y_train, y_test = train_test_split(x,y, test_size =0.3, random_state=42)

reg = LinearRegression()
reg.fit(x_train, y_train)
y_pred = reg.predict(x_test)

# Plot outputs
plt.scatter(x_test, y_test,  color='black')
plt.plot(x_test, y_pred, color='blue', linewidth=3)
plt.title('Predictive Millitary spending BRIC')
plt.xlabel('Years')
plt.ylabel('Increase')

plt.show()

Predictive Military spending BRIC

I Also Made a Logistical regression to predict that the projected combined BRIC Military spending

In [37]:
x = np.unique(Year).reshape(-1,1) 
y = RUS

x_train, x_test, y_train, y_test = train_test_split(x,y, test_size =0.3, random_state=42)

reg = LinearRegression()
reg.fit(x_train, y_train)
y_pred = reg.predict(x_test)

# Plot outputs
plt.scatter(x_test, y_test,  color='black')
plt.plot(x_test, y_pred, color='blue', linewidth=3)
plt.xlabel('Years')
plt.ylabel('Millitary spending Russia')

plt.show()

Discussion/Conclusion/Recommendations

Starting out with the original problem I wanted to see how the United States compared to other BRIC countries because if they can have influence over the U.S. economically they can presumably also have some influence militarily.

Military Spending: BRIC Countries And U.S This Line Graph Shows the military spending of the U.S. and Other BRIC Countries Individually.

Military Spending: BRIC Combined Countries And U.S. This Line Graph Shows the military spending of the U.S. and Other BRIC Countries Combined

Predictive Military spending BRIC The logistical Reggresion shows the possibility of how the Bric Counrites Coul rival the United States in military spending in the coming years.

It would be interesting to get Data from more recent years for completeness. It would also be interesting to see how the more Recent 2019-20 coronavirus outbreak will affect military spending around the world. Also it makes the argument if countries should be spending more on the military to protect themselves or is having a powerful military a result of having a prosperous country. With that it’s interesting to see how military spending will play out in the coming years.

In [ ]: