Python Programming: Bachelor of Computer Application
Python Programming: Bachelor of Computer Application
Python Programming: Bachelor of Computer Application
On
PYTHON PROGRAMMING
Submitted in partial fulfillment of the
requirement for the award of the degree
of
Submitted by
Kushagra Srivastava
201710101130096
October – 2019
DECLARATION
I hereby declare that this submission is my own work and that, to the best of my
knowledge and belief, it contains no material previously published or written by
another person nor material which to a substantial extent has been accepted for the
award of any other degree or diploma of the university or other institute of higher
learning, except where due acknowledgment has been made in the text.
i|Page
ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B.C.A. Project
undertaken during B.C.A. Final Year. We owe special debt of gratitude to Ms. Anshita
Raj, Department of Computer Application, Shri Ramswaroop Memorial University for
his constant support and guidance throughout the course of our work.
We also take the opportunity to acknowledge the contribution of Professor Dr. B.K.
Gupta, Head, Department of Computer Application, Shri Ramswaroop Memorial
University, Lucknow for his full support and assistance during the development of the
project.
We also do not like to miss the opportunity to acknowledge the contribution of all
faculty members of the department for their kind assistance and cooperation during the
development of our project. Last but not the least, we acknowledge our friends for their
contribution in the completion of the project.
ii | P a g e
ABSTRACT
Apart from the above-mentioned features, Python has a big list of good features, few
are listed below −
It supports functional and structured programming methods as well as OOP.
It can be used as a scripting language or can be compiled to byte-code for building large
applications.
It provides very high-level dynamic data types and supports dynamic type checking.
It supports automatic garbage collection.
It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
iii | P a g e
ABOUT COMPANY
CETPA INFOTECH PVT LTD is the leader in the “specialized training” brands of
India certified by ISO 9001:2015 for its best quality. CETPA INFOTECH is the
largest training service provider in various engineering domains for all engineering
students as well as for the working professionals. It has an extensive experience
of nurturing over 200000+ students in the past few years.
CETPA has been awarded as the “Best IT and Embedded Training Company” for 5
consecutive years for delivering high quality training and workshops at more than
500 colleges across India. CETPA is a trustworthy brand in Education and Training
industry with its presence across several cities such as Noida, Roorkee, Lucknow,
Dehradun and . The company was started 12 years back and it is continuously
expanding having its overseas branches in Germany and Ukraine.
iv | P a g e
v|Page
TABLE OF CONTENTS
Page No.
Declaration i
Acknowledgement ii
Abstract iii
About Company/industry/institute iv
Chapter 1: Introduction
1.1 Features of Python ………………………………………………………………… 1
1.2 Introduction to Data Exploration using Python……………………………………. 2
1.2.1 How to load data file(s)?............................................................................. 2
1.2.2 How to convert a variable to different data type?....................................... 3
1.2.3 How to transpose a table?.......................................................................... 5
1.2.4 How to sort Data?...................................................................................... 6
1.2.5 How to create plots (Histogram, Scatter, Box Plot)?.................................. 7
References 22
vi | P a g e
Introduction
Python is a widely used general-purpose, high level programming language. It was initially
designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It was
mainly developed for emphasis on code readability, and its syntax allows programmers to
express concepts in fewer lines of code.
Python is a programming language that lets you work quickly and integrate systems more
efficiently.
There are two major Python versions- Python 2 and Python 3. Both are quite different.
Python can run equally on different platforms such as Windows, Linux, Unix
and Macintosh etc. So, we can say that Python is a portable language.
Python supports object oriented language and concepts of classes and objects
come into existence.
1|Page
1.1.7) Extensible
It implies that other languages such as C/C++ can be used to compile the
code and thus it can be used further in our python code.
Python has a large and broad library and prvides rich set of module and
functions for rapid application development.
1.1.10) Integrated
Python has been gaining a lot of ground as preferred tool for data scientists lately, and for the right
reasons. Ease of learning, powerful libraries with integration of C/C++, production readiness and
integration with web stack are some of the main reasons for this move lately.
In this guide, I will use NumPy, Matplotlib, Seaborn and Pandas to perform data exploration. These
are powerful libraries to perform data exploration in Python. The idea is to create a ready reference
for some of the regular operations required frequently. I am using iPython Notebook to perform data
exploration, and would recommend the same for its natural fit for exploratory analysis.
Input data sets can be in various formats (.XLS, .TXT, .CSV, JSON ).
In Python, it is easy to load data from any source, due to its simple syntax
and availability of predefined libraries. Here I will make use of Pandas. It
features a number of functions for reading tabular data as a DataFrame
object. Below are the common functions that can be used to read data.
2|Page
Loading data from CSV file(s):
Code
import pandas as pd
Output
3|Page
Converting a variable data type to other is important and common procedure
we perform after loading data. Let’s look at some of the commands to perform
these conversions:
The later operations are especially useful when you input value from user using raw_input().
By default, the values are read at string.
There are multiple ways to do this. The simplest would be to use datetime library and
strptime function. Here is the code:
print date_obj
4|Page
1.2.3) How to transpose a table?
Here, I want to transpose Table A into Table B on variable Product. This task
can be accomplished by using dataframe.pivot.
Code
print df
result
Output
5|Page
1.2.4) How to sort Data?
Code
#Sorting Dataframe
6|Page
Above, we have a table with variables ID, Product and Sales. Now, we want to sort it by
Product and Sales (in descending order)
Data visualization always helps to understand the data easily. Python has library
like matplotlib and seaborn to create multiple graphs effectively. Let’s look at the some of
the visualization to understand below behavior of variable(s) .
Histogram:
Code
7|Page
#Plot Histogram
import pandas as pd
df=pd.read_excel(“E:/First.xlsx”, “Sheet1”)
#Plots in matplotlib reside within a figure object, use plt.figure to create new figu
re
fig=plt.figure()
#Create one or more subplots using add_subplot, because you can’t create blank figure
ax = fig.add_subplot(1,1,1)
#Variable
ax.hist(df[‘Age’],bins = 5)
plt.title(‘Age distribution’)
plt.xlabel(‘Age’)
plt.ylabel(‘#Employee’)
8|Page
plt.show()
Output
Scatter plot:
Code
#Plots in matplotlib reside within a figure object, use plt.figure to create new figu
re fig=plt.figure()
#Create one or more subplots using add_subplot, because you can’t create blank figure
ax = fig.add_subplot(1,1,1)
#Variable
ax.scatter(df[‘Age’],df[‘Sales’])
9|Page
#Labels and Tit
plt.xlabel(‘Age’)
plt.ylabel(‘Sales’)
plt.show()
Output
Box-plot:
Code
10 | P a g e
import seaborn as sns
sns.boxplot(df[‘Age’])
sns.despine()
Output
11 | P a g e
Project Work
2.1 Introduction
JAVASCRIPT (JS)
12 | P a g e
2.1.2) Back – End
MySQL
Django
13 | P a g e
2.3) How Django interacts with the user
14 | P a g e
Open browser and type 127.0.0.1:8000
Structure
• The outer mysite/ root directory is just a container for your project. Its name doesn’t
matter to Django; you can rename it to anything you like.
• manage.py: A command-line utility that lets you interact with this Django project in
various ways. You can read all the details about manage.py in 15jango-admin and
manage.py.
• The inner mysite/ directory is the actual Python package for your project. Its name is the
Python package name you’ll need to use to import anything inside it (e.g. mysite.urls).
15 | P a g e
• mysite/__init__.py: An empty file that tells Python that this directory should be
considered a Python package. If you’re a Python beginner, read more about packages in
the official Python docs.
• mysite/urls.py: The URL declarations for this Django project; a “table of contents” of
your Django-powered site. You can read more about URLs in URL dispatcher.
16 | P a g e
1. Django determines the root URLconf module to use. Ordinarily, this is the value of the
ROOT_URLCONF setting
2. Django loads that Python module and looks for the variable urlpatterns
3. Django runs through each URL pattern, in order, and stops at the first one that matches
the requested URL.
4. Once one of the URL patterns matches, Django imports and calls the given view, which
is a simple Python function (or a class-based view). The view gets passed the following
arguments:
A. An instance of HttpRequest.
B. If the matched URL pattern returned no named groups, then the matches from the
regular expression are provided as positional arguments.
C. The keyword arguments are made up of any named parts matched by the path
expression, overridden by any arguments specified in the optional kwargs
argument to 17jango.urls.path() or 17jango.urls.re_path().
5. If no URL pattern matches, or if an exception is raised during any point in this process,
Django invokes an appropriate error-handling view.
2.7) Database
‘default’:
‘ENGINE’: ‘django.db.backends.mysql',
'NAME': 'onlineshop',
'USER': 'root',
17 | P a g e
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '3306'
}
Structure of Database
It has the rights to update website items and also it can add new products ,
users and all the things which administrator does.
18 | P a g e
2. Registration Page
19 | P a g e
3. Login Page
It allows the user to login into the website. If user is not registered, there is a
redirection for registration page on it.
• It allows the user to checkout the products that he added to his cart so that
afterwards a detailed bill of the products would be generated.
20 | P a g e
CONCLUSION AND FUTURE SCOPE
Digital Marketing scope in future of marketing will not only thrive in the most result -oriented
fashion but also let businesses survive. Following latest updates, including new techniques of
Google and combining future trends in digital marketing will let your inbound marketing
acquire great benefits for you in 2018.
It will be worthwhile for you to climb on to the digital bandwagon when the time is right as
Digital Marketing sure remains as the most effective way of marketing in the future too, either
business-wise or career-wise.
In today’s world of internet, Digital Marketing is the only one and most guaranteed way of
marketing, which is popularly being the most preferred space for marketing communications
and related interactions.
The future of marketing is way beyond the traditional marketing and now, marketing is
majorly based on the Digital Sphere. The scope of Digital Marketing provides some of the
most powerful techniques of marketing where traditional modes of marketing fail.
The great panjandrum on Digital Marketing over industrialists is to empower them and to
optimize their start-ups in the quickest possible and most cost-effective fashion. Future of
digital marketing is going to be more encompassing in 2018. Undoubtedly, it is an undeniable
fact that there is a great scope in digital marketing.
The things that are considered for Digital marketing are like –
21 | P a g e
Conversion through SMO & SEO campaigns
Optimization of internet marketing & associated ROI
Marketing on Digital World & Banner ads on other websites
REFRENCES
1. https://www.geeksforgeeks.org/python-language-introduction/
2. https://www.analyticsvidhya.com/blog/2015/04/comprehensive-guide-data-exploration-sas-
using-python-numpy-scipy-matplotlib-pandas/
3. NIIT E–Books of Django
4. Slides of Django Project by NIIT
5. https://www.excelr.com/the-future-scope-of-digital-marketing
22 | P a g e