#!/usr/bin/env python # coding: utf-8 # ## Independent Project №1: Car Market in Russia, Dynamics and Current Situation # # The purpose of this project is to study the situation on the car market in Russia and its dependence on imports. # # # Part 1. Analysis of Imports to Russia # # In this part of the project, we will make analysis of the situation with imports in Russia in general and for certain groups of goods in particular.\ # Following our main goal, we will try to determine the place of car imports in total imports.\ # The data was collected from various open sources, combined in an MS Excel Sheet files, modified and saved in a .csv files. # # *Notification. Different sources provide different data, in the following analysis missing or different data are calculated on the basis of indirect information.* # In[1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') import seaborn as sns from scipy.signal import savgol_filter # ## Introduction # # Sources: # - Imports from January 2017 to June 2021: [Ru-Stat](https://ru-stat.com/date-Q201801-202104/RU/import/world). # - Imports from July 2021 to December 2021: [FinMarket](http://www.finmarket.ru/news/5648539). # - Exchange rate RUR/USD: [TradingEconomics](https://tradingeconomics.com/russia/currency). # - World Imports 2017-20: [TrandEconomy](https://trendeconomy.ru/data/commodity_h2?commodity=TOTAL&indicator=TV,tv_wrld_share,wrld_rank&trade_flow=Import&time_period=2020). # - World Imports 2021: [RT](https://russian.rt.com/business/article/963496-torgovlya-mir-rossiya-rost). # # Glossary: # - Billion (BN) has value 1,000,000,000, it is a name for Thousand million unit using is US, Canada and modern British, Traditional European is Milliard ([Wikipedia](https://en.wikipedia.org/wiki/Names_of_large_numbers)). # - Import is a good or service bought in one country that was produced in another ([Investopedia](https://www.investopedia.com/terms/i/import.asp)) # # Agreement: # To simplify the following descriptions, explanations and conclusions, we will use the following terms: # - 'Import': import to Russia in total volume. # - 'Transport': vehicles, aircraft, vessels and associated transport equipment. # - 'Ground Transport': vehicles other than railway or tramway rolling stock, and parts and accessories thereof. # - 'Vehicles', also 'Cars and their Parts': motor cars and other motor vehicles principally designed for the transport of persons. # The table below demonstrate the place of Russia in world imports (Table 1). # In[22]: position_rus = pd.read_csv('Russian_Position.csv') print('Table 1. The Position of Russia in World Imports, 2017-20') position_rus[['Year', 'Cost (USD BN)', 'Share in the World ($), %', 'World Ranking'] ] # Imports to Russia in 2017-20 accounts for less than 1.5% of world imports. Nevertheless, Russia ranks 21st on average in terms of imports over the past five years, so the impact of supplies to Russia on the economies of other countries cannot be ignored. # ## Chapter 1. Import to Russia (US Dollars), Dynamic from 2017 to 2021 # # In the following analysis, we will use a dataset prepared specifically for this study. # In[3]: import_cars = pd.read_csv('Import_Total.csv') print ('The dataset contains', import_cars.shape[0], 'rows and ', import_cars.shape[1], 'columns.') # **Attibute Information (Grouped by Meaning):** # # |Attribute | Description | # | :------ | :--------- | # |Period| Quarter of the year in format YYYY/QQ| # |Import| Total imports for the quarter in USD billion| # |Transport|Vehicles, aircraft, vessels and associated transport equipment for the quarter in USD billion | # |Ground_Transport| Vehicles other than railway or tramway rolling stock, and parts and accessories thereof for the quarter in USD billion| # |Vehicles| Motor cars and other motor vehicles principally designed for the transport of persons for the quarter in USD billion| # |Growth_Import| Import growth in percent to 1th quarter 2017| # |Growth_Transport| Transport growth in percent to 1th quarter 2017| # |Growth_G_Transport| Ground transport growth in percent to 1th quarter 2017| # |Growth_Vehicles| Vehicles growth in percent to 1th quarter 2017| # |Transport/Import |Share of transport in import volume| # |G_Transport/Import |Share of ground transport in import volume| # |Vehicles/Import |Share of vehicles in import volume| # |RUR/USD| The exchange rate of the Russian ruble against the USD on the first working day of the quarter| # |Import_RUR|Total imports in Russian ruble| # |Vehicle_RUR|Car and part imports in Russian ruble| # In[4]: import_cars.head(1) # In[5]: import_cars.tail(1) # **1.1. Imports in Total, 2017-21** # # In this section, we will analyze imports to Russia in total volume (in billions of US dollars) from 2017 to 2021. # In[6]: fig, ax = plt.subplots(figsize=(12, 6)) x=import_cars['Period'] y1= import_cars['Import'] y1_2= savgol_filter(import_cars['Import'], 9, 3) y2= import_cars['Transport'] y2_1= savgol_filter(import_cars['Transport'], 9, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Import'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Import'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Import'] ax.bar(x, y1, color ='lightgreen', label = 'Total Import') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed' ) ax.bar(x, y2, color ='darkgreen', label= 'Import of Transport') plt.plot(x, y2_1, color = 'red', linewidth=2, linestyle='dashed' ) plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1-5, '45.4 BN', style='italic', size= 12) plt.text(x_point_2, y_point_2-5, '52.4 BN', style='italic', size= 12) plt.text(x_point_3, y_point_3-5, '85.4 BN', style='italic', size= 12) plt.text(x= '2018Q2', y= 90, s= 'Chart 1.1/1', fontsize = 12) plt.text(x= '2018Q2', y= 85, s= 'Imports in Total, 2017-21', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('USD Billion', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.axhline(y = 10, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=12, s='10 BN', size=10, color='black') plt.axhline(y = 50, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=52, s='50 BN', size=10, color='black') plt.axhline(y = 80, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=82, s='80 BN', size=10, color='black') plt.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = 'center right') plt.show() # The diagram above (Chart 1.1/1) shows the following: # - over the past 5 years, imports to Russia increased from 45.4 billion to 85.4 billion, # - growth occurred in 2017, then imports remained almost at the same level until the end of 2020, # - even in 2020, against the background of the pandemic, imports did not decrease too much and remained higher than in 2017 on the 10 BN USD, # - The most significant jump occurred in 2021. # # In addition, import of transport are not the main part of imports to Russia. # # Our next step will be to explore the growth of imports compared to the beginning of the period we are studying. # In[7]: fig, ax = plt.subplots(figsize=(12, 6)) x=import_cars['Period'] y1= import_cars['Growth_Import'] y1_2= savgol_filter(import_cars['Growth_Import'], 9, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Growth_Import'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Growth_Import'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Growth_Import'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed' ) plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1+1, '100%', style='italic', size= 12) plt.text(x_point_2, y_point_2-5, '+15%', style='italic', size= 12) plt.text(x_point_3, y_point_3-5, '+88%', style='italic', size= 12) plt.text(x= '2017Q4', y= 90, s= 'Chart 1.1/2', fontsize = 12) plt.text(x= '2017Q4', y= 85, s= 'Growth in Imports Compared to the 1st Quarter of 2017', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('% to 1st Quarter of 2017', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.axhline(y = 20, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=21, s='+20%', size=10, color='black') plt.axhline(y = 50, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=51, s='+50%', size=10, color='black') plt.axhline(y = 80, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=81, s='+80%', size=10, color='black') plt.show() # The chart above (Chart 1.1/2) shows the following: # - to the end of 2021 import to Russia increased on 88% compared to the 1st quarter of 2017; # - there is rather clear pattern in the dynamic of imports: the drop on the 1st quarter of the year and significant growth to the last quarter; # - in the 1st and 2nd quarters of 2020 (the beginning of the pandemic), imports decreased more than usual in this time of the year, but it was more than level of 2017 anyway. # **1.2. Imports of Transport, 2017-21** # # In this section, we analyze imports to Russia of any type of transport and transport equipment (in billions of US dollars) from 2017 to 2021. # In[8]: fig, ax = plt.subplots(figsize=(12, 4)) x=import_cars['Period'] y1= import_cars['Transport'] y1_1= savgol_filter(import_cars['Transport'], 11, 3) y2= import_cars['Ground_Transport'] y2_1= savgol_filter(import_cars['Ground_Transport'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Transport'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Transport'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Transport'] ax.bar(x, y1, color ='greenyellow', label = 'Transport') plt.plot(x, y1_1, color = 'red', linewidth=2, linestyle='dashed') ax.bar(x, y2, color ='lightgreen', label= 'Ground Transport') plt.plot(x, y2_1, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1-1, '4.79 BN', style='italic', size= 12) plt.text(x_point_2, y_point_2-1, '3.93 BN', style='italic', size= 12) plt.text(x_point_3, y_point_3-1, '9.05 BN', style='italic', size= 12) plt.text(x= '2018Q2', y= 10.2, s= 'Chart 1.2/1', fontsize = 12) plt.text(x= '2018Q2', y= 9.5, s= 'Imports of Transport, 2017-21', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('USD Billion', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.axhline(y = 5, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=5.2, s='5 BN', size=10, color='black') plt.axhline(y = 9, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=9.2, s='9 BN', size=10, color='black') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = 'center right') plt.show() # The diagram above (Chart 1.2/1) shows the following: # - over the past 5 years, transport imports to Russia have increased from 4.79 billion to 9.05 billion USD, # - growth occurred in 2017, then imports practically remained at the same level until the end of 2019, # - in 2020, against the backdrop of the pandemic, the import of transport decreased noticeably to 3.93 billon USD, # - from the 4th quarter of 2019 to the end of 2021, transport imports grew more than twice compared to the second quarter of 2020. # # In addition, ground transport imports account for the bulk of transport imports. # # Our next step will be to explore the growth of transport imports compared to the beginning of the period we are studying. # In[9]: fig, ax = plt.subplots(figsize=(12, 6)) x=import_cars['Period'] y1= import_cars['Growth_Transport'] y1_2= savgol_filter(import_cars['Growth_Transport'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Growth_Transport'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Growth_Transport'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Growth_Transport'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1+2, '100%', style='italic', size= 12) plt.text(x_point_2, y= -16, s='-18%', style='italic', size= 12) plt.text(x_point_3, y_point_3-5, '+89%', style='italic', size= 12) plt.text(x= '2018Q2', y= 98, s= 'Chart 1.2/2', fontsize = 12) plt.text(x= '2018Q2', y= 85, s= ' Growth in Imports of Transport,\nCompared to the 1st Quarter of 2017', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('% to 1st Quarter of 2017', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.axhline(y = -20, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=-19, s='-20%', size=11, color='black') plt.axhline(y = 0, color = 'darkblue', linewidth=1, alpha= 0.8) plt.axhline(y = 20, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=21, s='+20%', size=11, color='black') plt.axhline(y = 50, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=51, s='+50%', size=11, color='black') plt.axhline(y = 80, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=81, s='+80%', size=11, color='black') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.show() # The diagram above (Chart 1.2/2) shows the following: # - at the end of 2021, transport imports to Russia increased by 89% compared to the 1st quarter of 2017; # - in the 2nd quarter of 2020 due to the pandemic, imports of transort fell by 18% below the level of 2017, and restored volumes only at the end of 2020. # # As we have found above, transport imports does not play important role in imports to Russia. However, let's study this fact closer. # In[10]: fig, ax = plt.subplots(figsize=(12, 4)) x=import_cars['Period'] y1= import_cars['Transport/Import'] y1_2= savgol_filter(import_cars['Transport/Import'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Transport/Import'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Transport/Import'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Transport/Import'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1+0.5, '10.6%', style='italic', size= 12) plt.text(x_point_2, y_point_2-1, s='7.5%', style='italic', size= 12) plt.text(x_point_3, y_point_3+0.5, '+10.6%', style='italic', size= 12) plt.text(x= '2018Q1', y= 13.8, s= 'Chart 1.2/3', fontsize = 12) plt.text(x= '2018Q1', y= 13, s= 'Share of Transport Imports in Total Imports', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('% to Total Imports', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.text(x='2017Q1', y=5.2, s='5%', size=11, color='black') plt.axhline(y = 7.5, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=7.7, s='7.5%', size=11, color='black') plt.axhline(y =10, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=9.5, s='10%', size=11, color='black') plt.axhline(y = 12, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=12.2, s='12%', size=11, color='black') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.ylim(5, 13) plt.show() # The diagram above (Chart 1.2/3) shows the following: # - at the end of 2021, transport imports to Russia took the same place in total imports as in 2021; # - in the 2nd quarter of 2020, the share of transport imports decreased significantly to 7.5% of total imports; # - the impact of land transport imports on the Russian economy cannot be a critical circumstance (nearly 10% of total imports), but at the same time it must be a significant factor. # **1.3. Imports of Grounds Transport, 2017-21** # # In this section, we analyze imports to Russia of vehicles, their parts and accessories (in billions of US dollars) from 2017 to 2021. # In[11]: fig, ax = plt.subplots(figsize=(12, 4)) x=import_cars['Period'] y1= import_cars['Ground_Transport'] y1_1= savgol_filter(import_cars['Ground_Transport'], 11, 7) y2= import_cars['Vehicles'] y2_1= savgol_filter(import_cars['Vehicles'], 7, 5) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Ground_Transport'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Ground_Transport'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Ground_Transport'] ax.bar(x, y1, color ='lightgreen', label='Ground Transport') plt.plot(x, y1_1, color = 'red', linewidth=2, linestyle='dashed') ax.bar(x, y2, color ='darkgreen', label='Vehicles') plt.plot(x, y2_1, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1-0.7, '4.39 BN', style='italic', size= 12) plt.text(x_point_2, y_point_2-0.7, '3.23 BN', style='italic', size= 12) plt.text(x_point_3, y_point_3-0.7, '7.94 BN', style='italic', size= 12) plt.text(x= '2018Q1', y= 9.2, s= 'Chart 1.3/1', fontsize = 12) plt.text(x= '2018Q1', y= 8.5, s= 'Imports of Ground Transport, 2017-21', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('USD Billion', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.axhline(y = 2, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=2.2, s='2 BN', size=10, color='black', weight ='light', alpha =0.8) plt.axhline(y = 5, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=5.2, s='5 BN', size=10, color='black', weight ='light', alpha =0.8) plt.axhline(y = 8, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=8.2, s='8 BN', size=10, color='black', weight ='light', alpha =0.8) ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = 'center right') plt.show() # The diagram above (1.3/1) shows the following: # - over the past 5 years, ground transport imports to Russia have increased from 4.39 billion to 7.94 billion, # - growth occurred in 2017, then imports practically remained at the same level until the end of 2019, # - in 2020, against the backdrop of the pandemic, the import of ground transport decreased noticeably to 3.23 billion USD, # - from the 4th quarter of 2020 to the end of 2021, transport imports grew significantly, almost twice. # # In addition, imports of passenger cars and their parts account for about 1/3 of the volume of ground transport. # # Our next step will be to explore the growth of transport imports compared to the beginning of the period we are studying. # In[12]: fig, ax = plt.subplots(figsize=(12, 6)) x=import_cars['Period'] y1= import_cars['Growth_G_Transport'] y1_2= savgol_filter(import_cars['Growth_G_Transport'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Growth_G_Transport'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Growth_G_Transport'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Growth_G_Transport'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1+2, '100%', style='italic', size= 12) plt.text(x_point_2, y= -18, s='-26%', style='italic', size= 12) plt.text(x_point_3, y_point_3+2, '+81%', style='italic', size= 12) plt.text(x= '2018Q2', y= 98, s= 'Chart 1.3/2', fontsize = 12) plt.text(x= '2018Q2', y= 85, s= 'Growth in Imports of Ground Transport\n Compared to the 1st Quarter of 2017', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel(' % to 1st Quarter of 2017', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.axhline(y = -20, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=-19, s='-20%', size=11, color='black') plt.axhline(y = 0, color = 'darkblue', linewidth=1, alpha= 0.8) plt.axhline(y = 20, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=22, s='+20%', size=11, color='black') plt.axhline(y = 50, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=52, s='+50%', size=11, color='black') plt.axhline(y = 80, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=82, s='+80%', size=11, color='black') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.show() # The diagram above (Chart 1.3/2) shows the following: # - at the end of 2021, ground transport imports to Russia increased by 81% compared to the 1st quarter of 2017; # - in the 2nd quarter of 2020 due to the pandemic, imports of ground transort fell by 18% below the level of 2017, and restored volumes only at the end of 2020. # # Now let's study the place of ground transport imports in the imports to Russia. # In[13]: fig, ax = plt.subplots(figsize=(12, 4)) x=import_cars['Period'] y1= import_cars['G_Transport/Import'] y1_2= savgol_filter(import_cars['G_Transport/Import'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['G_Transport/Import'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['G_Transport/Import'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['G_Transport/Import'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1-0.5, '9.7%', style='italic', size= 12) plt.text(x_point_2, y_point_2-0.5, s='6.2%', style='italic', size= 12) plt.text(x_point_3, y_point_3-0.5, '9.3%', style='italic', size= 12) plt.text(x= '2018Q1', y= 11.5, s= 'Chart 1.3/3', fontsize = 12) plt.text(x= '2018Q1', y= 11, s= 'Share of Ground Transport Imports in Total Imports', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('% to Total Imports', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.text(x='2017Q1', y=5.2, s='5%', size=11, color='black') plt.axhline(y = 7.5, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=7.7, s='7.5%', size=11, color='black') plt.axhline(y =10, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=10.2, s='10%', size=11, color='black') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.ylim(5, 11) plt.show() # The diagram above (1.3/3) shows the following: # - at the end of 2021, land transport imports to Russia occupied a slightly smaller place in total imports than in 2017 (0.4% less); # - in the 2nd quarter of 2020, the share of land transport imports decreased to 6.2% of total imports; # - the impact of land transport imports on the Russian economy cannot be a critical circumstance (less than 10% of total imports), but at the same time it can be a significant factor. # **1.4. Imports of Cars and their Parts , 2017-21** # # In this section, we analyze imports of passenger cars and their parts to Russia (in billions of US dollars) from 2017 to 2021. # In[14]: fig, ax = plt.subplots(figsize=(12, 4)) x=import_cars['Period'] y1= import_cars['Vehicles'] y1_1= savgol_filter(import_cars['Vehicles'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Vehicles'] x_point_2 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_2= import_cars[import_cars['Period']=='2021Q4']['Vehicles'] x_point_3 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_3= import_cars[import_cars['Period']=='2020Q2']['Vehicles'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_1, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1+0.2, '1.33 BN', style='italic', size= 12) plt.text(x_point_2, y_point_2-0.2, '2.48 BN', style='italic', size= 12) plt.text(x_point_3, y_point_3-0.2, '0.83 BN', style='italic', size= 12) plt.text(x= '2018Q1', y= 2.9, s= 'Chart 1.4/1', fontsize = 12) plt.text(x= '2018Q1', y= 2.5, s= 'Imports of Passenger Cars and their Parts\n from 2017 to 2021', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('USD Billion', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.axhline(y = 1, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=1.1, s='1 BN', size=10, color='black', weight ='light', alpha =0.8) plt.axhline(y = 2, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=2.1, s='2 BN', size=10, color='black', weight ='light', alpha =0.8) ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.show() # The diagram above (Chart 1.4/1) shows the following: # - over the past 5 years, imports of passenger cars and their parts to Russia have increased from 1.33 billion to 2.48 billion, # - growth occurred in 2017, then imports practically remained at the same level until the end of 2019, # - in 2020, against the background of the pandemic, imports of cars decreased to 0.83 billion, # - from the 4th quarter of 2020 to the end of 2021, imports of cars increased significantly. # # Our next step will be to explore the growth of transport imports compared to the beginning of the period we are studying. # In[15]: fig, ax = plt.subplots(figsize=(12, 4)) x=import_cars['Period'] y1= import_cars['Growth_Vehicles'] y1_2= savgol_filter(import_cars['Growth_Vehicles'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Growth_Vehicles'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Growth_Vehicles'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Growth_Vehicles'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1+3, '100%', style='italic', size= 12) plt.text(x_point_2, y_point_2+3, s='-36%', style='italic', size= 12) plt.text(x_point_3, y_point_3+3, '+86%', style='italic', size= 12) plt.text(x= '2018Q2', y= 105, s= 'Chart 1.4/2', fontsize = 12) plt.text(x= '2018Q2', y= 85, s= 'Growth in Imports of Cars and their Parts \n Compared to the 1st Quarter of 2017', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('% to 1st Quarter of 2017', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 45) plt.axhline(y = -30, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=-28, s='-30%', size=11, color='black') plt.axhline(y = 0, color = 'darkblue', linewidth=1, alpha= 0.8) plt.axhline(y = 20, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=21, s='+20%', size=11, color='black') plt.axhline(y = 50, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=51, s='+50%', size=11, color='black') plt.axhline(y = 80, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=81, s='+80%', size=11, color='black') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.ylim(-40, 90) plt.show() # The diagram above (1.4/2) shows the following: # - at the end of 2021, imports of pasenger cars and their parts to Russia increased by 86% compared to the 1st quarter of 2017; # - in the 2nd quarter of 2020 due to the pandemic, imports of vehicles fell by 36% below the level of 2017, and restored volumes only at the end of 2020. # In[16]: fig, ax = plt.subplots(figsize=(12, 4)) x=import_cars['Period'] y1= import_cars['Vehicles/Import'] y1_2= savgol_filter(import_cars['Vehicles/Import'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Vehicles/Import'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Vehicles/Import'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Vehicles/Import'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_2, color = 'red', linewidth=2, linestyle='dashed') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1-0.3, '2.93%', style='italic', size= 12) plt.text(x_point_2, y_point_2-0.3, s='1.58%', style='italic', size= 12) plt.text(x_point_3, y_point_3-0.3, '2.9%', style='italic', size= 12) plt.text(x= '2017Q4', y=4.1, s= 'Chart 1.4/3', fontsize = 12) plt.text(x= '2017Q4', y=3.8, s= 'Share of Imports of Cars and their Parts in Total Imports', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('% to Total Imports', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) plt.axhline(y = 1, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=1.1, s='1%', size=11, color='black') plt.axhline(y = 2, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=2.1, s='2%', size=11, color='black') plt.axhline(y =3, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=3.2, s='3%', size=11, color='black') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.show() # The diagram above (1.4/3) shows the following: # - at the end of 2021, passenger transport imports to Russia occupied the same place in total imports as in 2017 (only 0.3% less); # - in the 2nd quarter of 2020, the share of vehicle imports decreased to 1.58% of total imports; # - the impact of cars imports on the Russian economy is not at all a critical circumstance (less than 3% of all imports), but should be considered as a part of transport imports. # ## Chapter 2. Import to Russia (Russian Ruble) # # The study cited above (Chapter 1) showed a significant increase in imports to Russia in general over the past five years and any transport groups in particular, including imports of cars. One of the reasons for such a noticeable growth, all sources call the rise in prices. An indirect indicator of price growth is the exchange rate of the Russian ruble against the US dollar: the higher the exchange rate, the lower the purchasing power of the Russian ruble, which leads to an increase in the volume of imports in US dollars. # # In this chapter, we will try to find the relationship between the growth of the ruble / US dollar exchange rate and the volume of imports.\ # *Notification. Import volumes in Russian rubles are calculated based on the respective exchange rates.* # **2.1. Total Import to Russia in Russian Ruble, 2017-21** # # In this section, we analyze imports in total (in billions of Russian ruble) from 2017 to 2021. # In[17]: fig, ax = plt.subplots(figsize=(12, 6)) x=import_cars['Period'] y1= import_cars['Import_RUR'] y1_2_rub= savgol_filter(import_cars['Import_RUR'], 7, 3) y1_2_rate= savgol_filter(import_cars['RUR/USD'], 15, 3) y1_3= savgol_filter(import_cars['Import'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Import_RUR'] x_point_2 =import_cars[import_cars['Period']=='2020Q1']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q1']['Import_RUR'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Import_RUR'] ax.bar(x, y1, color ='lightgreen') ax.plot(x, y1_2_rub, color = 'red', linewidth=2, linestyle='dashed', label = 'Import RUR' ) plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1-200, '2834 BN', style='italic', size= 12) plt.text(x_point_2, y_point_2-200, '3327 BN', style='italic', size= 12) plt.text(x_point_3, y_point_3-200, '6226 BN', style='italic', size= 12) plt.text(x= '2017Q4', y= 6300, s= 'Chart 2.1/1', fontsize = 12) plt.text(x= '2017Q4', y= 6000, s= 'Imports in Total in Russian Ruble, 2017-21', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('RUR Billion', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 90) ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) plt.axhline(y = 3000, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=3050, s='3000 BN', size=10, color='black') plt.axhline(y = 4000, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=4050, s='4000 BN', size=10, color='black') plt.axhline(y = 5000, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=5050, s='5000 BN', size=10, color='black') ax2=ax.twinx() ax2.plot(x, y1_2_rate, color = 'royalblue', linewidth=2, linestyle='dashed', label= 'RUR/USD' ) ax2.spines['right'].set_visible(False) ax2.spines['top'].set_visible(False) plt.yticks([]) ax3=ax.twinx() ax3.plot(x, y1_3, color = 'darkgreen', linewidth=2, linestyle='dashed', label= 'Import USD' ) ax3.spines['right'].set_visible(False) ax3.spines['top'].set_visible(False) plt.yticks([]) ax.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = (0.75, 0.55)) ax2.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = (0.10, 0.15)) ax3.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = (0.75, 0.35)) plt.show() # In[18]: corr_1 = import_cars['Import_RUR'].corr(import_cars['RUR/USD'], method= 'spearman').round(2) print('Correlation between imports in Russian ruble and exchange rate Russian ruble to US dollar is', corr_1, ', this is the strong dependencies.') # In the chart above (Chart 2.1/1) we see the following: # - The total volume of imports in US dollars and in Russian rubles changes approximately the same, but their change is not quite equal. Thus, in addition to changes in the exchange rate, there must be other factors influencing the volume of imports. # - The similarity of the volatility of imports and the exchange rate on the line charts above is not so obvious, but as we saw above, the correlation coefficient shows a strong relationship between these criteria. # **2.2. Import to Russia of Cars and their Parts in Russian Ruble, 2017-21** # # In this section, we analyze imports of passenger vehicles and their parts (in billions of Russian ruble) from 2017 to 2021. # In[19]: fig, ax = plt.subplots(figsize=(12, 6)) x=import_cars['Period'] y1= import_cars['Vehicles_RUR'] y1_2= savgol_filter(import_cars['Vehicles_RUR'], 7, 3) y1_2_rate= savgol_filter(import_cars['RUR/USD'], 15, 3) y1_3= savgol_filter(import_cars['Vehicles'], 7, 3) x_point_1 =import_cars[import_cars['Period']=='2017Q1']['Period'] y_point_1= import_cars[import_cars['Period']=='2017Q1']['Vehicles_RUR'] x_point_2 =import_cars[import_cars['Period']=='2020Q2']['Period'] y_point_2= import_cars[import_cars['Period']=='2020Q2']['Vehicles_RUR'] x_point_3 =import_cars[import_cars['Period']=='2021Q4']['Period'] y_point_3= import_cars[import_cars['Period']=='2021Q4']['Vehicles_RUR'] ax.bar(x, y1, color ='lightgreen') plt.plot(x, y1_1, color = 'red', linewidth=2, linestyle='dashed', label= 'Import RUR') plt.plot(x_point_1, y_point_1, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_2, y_point_2, marker='o', markersize = 10, color='royalblue') plt.plot(x_point_3, y_point_3, marker='o', markersize = 10, color='royalblue') plt.text(x_point_1, y_point_1-12, '83 BN', style='italic', size= 12) plt.text(x_point_2, y_point_2+8, '55 BN', style='italic', size= 12) plt.text(x_point_3, y_point_3-12, '180 BN', style='italic', size= 12) plt.text(x= '2017Q3', y=200, s= 'Chart 2.2/1', fontsize = 12) plt.text(x= '2017Q3', y= 180, s= 'Imports of Passenger Cars and their Parts in Russian Ruble\n from 2017 to 2021', fontsize = 14, weight='bold') plt.xlabel('Year/Quarter', fontsize=12, weight = 'bold') plt.ylabel('RUR Billion', size=12, weight= 'bold') plt.tick_params(left=False) plt.xticks(rotation = 45) plt.axhline(y = 50, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=53, s='50 BN', size=10, color='black', weight ='light', alpha =0.8) plt.axhline(y = 100, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=103, s='100 BN', size=10, color='black', weight ='light', alpha =0.8) plt.axhline(y = 150, color = 'darkblue', linewidth=1, alpha= 0.8) plt.text(x='2017Q1', y=153, s='150 BN', size=10, color='black', weight ='light', alpha =0.8) ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.yticks([]) ax2=ax.twinx() ax2.plot(x, y1_2_rate, color = 'royalblue', linewidth=2, linestyle='dashed', label= 'RUR/USD' ) ax2.spines['right'].set_visible(False) ax2.spines['top'].set_visible(False) plt.yticks([]) ax3=ax.twinx() ax3.plot(x, y1_3, color = 'darkgreen', linewidth=2, linestyle='dashed', label= 'Import USD' ) ax3.spines['right'].set_visible(False) ax3.spines['top'].set_visible(False) plt.yticks([]) ax.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = (0.75, 0.55)) ax2.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = (0.10, 0.15)) ax3.legend(fancybox=True, framealpha = 1, borderpad = 1, shadow = True, loc = (0.75, 0.35)) plt.show() # In[20]: corr_2 = import_cars['Vehicles_RUR'].corr(import_cars['RUR/USD'], method='spearman').round(2) print('Correlation between imports of cars in Russian ruble and exchange rate Russian ruble to US dollar is', corr_1, ', this is the enough strong dependencies.') # On the chart above (Chart 2.2/1) we see the following: # - The volume of imports of passenger cars in US dollars and in Russian rubles changes approximately the same, and their change shows fairly equal ups and downs. Thus, the change in the exchange rate looks like one of the main factors in the volume of car imports. # - The similarity of import volatility and the exchange rate on the line charts above is not so obvious, but as we saw above, the correlation coefficient shows that the relationship between these criteria is quite strong. # ## Conclusion # This study examines the change in imports to Russia as a whole and for individual categories of goods. As we can see, all changes are within 1.5% of world imports. # In[23]: print('Table 2. The Share of Passenger Imports to Russia in Total World Import Volume, 2017-20') position_rus[['Year', 'Cost (USD BN, Cars)', 'Share in the World (Cars, $), %'] ] # Table 2 above shows that passenger transport imports to Russia are at the level of 0.04% of import commodity flows. # However, these tiny percentages are equal to billions of dollars, so their impact on the economies of individual importing countries can be significant. # # In the next part of our project, we will study the import flows of cars and their parts to Russia by country.