Term Paper Python
Term Paper Python
HCL Technology is a world know tech company which helps in recreating the business in this
modern digital world. Company has strong culture and has keen focus on relationship with it’s
customers. HCL Technology has helped many entrepreneurs across the globe to start there own
business on the digital platform.
3) Product and Platform provide industrial specified needs and modernized software
products through out the world.
It is Indian based multi national company and has it’s headquater at Noida,Uttar Pradesh,India.
CONTENT
1 INTRODUCTION TO PYTHON ----1
1.1 About Python ----- 1
1.2 Application of Python ----- 1
2 INVESTPY PACKAGE IN PYTHON----2
2.1 Introduction ----- 2
2.2 Installation of Investpy -----2
2.3 Usage of Investpy ---- 2-3
3 MATPLOTLIB PAKAGE IN PYTHON ---- 4
3.1 Introduction ---- 4
3.2 Plots type in matplotlib ----- 4-6
4 PROJECT(to analyse stock last 11 yrs closing price using investpy and put it on graph using
matplotlib) ---- 7-8
1 INTRODUCTION TO PYTHON
1.1 About Python
Python is high level language which supports the concept of object oriented
programing(OOPS) also it is functional. It is dynamic in nature which means we can assign value
to any variable without indicating it’s type. Python has built-in-data structures and has many
supportive packages and modules. These packages and modules help in the reusability of the
python codes. The syntax is easy and hence the cost of maintenance of codes is comaritively
low.
Python has fast productivity i.e it has small debugging cycle as there is no step for the
compilation. It was first appeared in the year 1991 and was founded by guido van. It is
supported on the OS like windows, mac, linux, etc and it’s stable version is Python 3.9.6.
Although there are many more use of Python but most importantly it is used in Deep learning,
machine learning and Artificial intelligence.
Python come with the advantage of ease of using same codes in Mac, windows as well as Linux.
1
2 INVESTPY PACKAGE IN PYTHON
2.1 Introduction
This package is used to fetch the data from the site called investing.com ,it provides
fething of many stocks, bonds, funds, currency exchanges,cryptocurrencies, etc. It gives
permission to user for downloading historical to recent data of all the products which are
registered on Investpy.com. Investpy package includes data from across the globe. Many major
counties include USA, Russia, India, Germany, Spain, etc.
Investpy is a portal for financial use and is owned by Fusion media limited. This company
provides news,quotes, streaming, charts, etc.
In Python 3.6 or in high versions we install it through pip at the terminal by typing :
$ pip install investpy
Apart from this, if latest version of this package investpy is required to be used instead
of the usage of stable variant, we can install it using command as follows:
$ pip install git+https://github.com/alvarobrtt/investpy.git@masters
This mastster branch provides assurance to the user that a fully operative and working latest
version of investpy will be working on there device.
The search engine is designed in such a way to integrate investpy directly with
the investpy.com. This allows user to adjust the parameters of product to tune live.
Example input—
import investpy
The support for the data retrieval of cryptos has been added recently after the
success of many cryptocurrency in recent years.
Example input—
import investpy
data = investpy.get_crypto_historical_data(crypto='erithrium',
from_date='01/01/2014',
to_date='01/01/2019')
3
3 MATPLOTLIB PAKAGE IN PYTHON
3.1 Introduction
Matplotlib package is used widely in python for the purpose of ploting different
numerical of any related value graphically. In the process of ploting data numpy is used to
generate data. We can also placegrids on the ploted graph using matplotlib.
We can also put title to the gram and mention the values which are ploted on x and y
axis. Subplots and also be made using plt.subplot(2,1,1).
4
3.2.2 Histograms
The command hist() is used to generate histograms.
5
3.2.4 Pie chart
It is made by command plt,pie(axis_name,labels).
6
4 PROJECT(to analyse stock last 11 yrs closing price using investpy and put it
on graph using matplotlib)
import investpy
import matplotlib.pyplot as plt
import pandas as pd
x=investpy.get_stock_historical_data(stock='AAPL',country='United
States',from_date='01/01/2010',
to_date='31/12/2020')
date=[]
closing_value=[]
for i in x['Close']:
closing_value.append(i)
for j in x['Date']:
date.append(j)
plt.plot(date,closing_value)
plt.xlabel('DATE')
plt.ylabel('CLOSING PRICE')
plt.show()
7
Result along with the codes: