We have analysed the Ecommerce Purchase .csv file and tried using all basic Python, Numpy and Pandas libraries to come up a insights. Enjoy the code snippet and leave us a feedback
why an Opensea Clone Script might be your perfect match.pdf
Â
Python for data analysis (ITP and NPV)
1. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan)
Python for Data Analysis
(ITP & NPV Group Project)
Chethan, Chandra, Nagabhushan and Divyamsh
Project Team 2
2. MTechProjectPresentation
2
Overview of Python Libraries for Data Analysis (Numpy
Pandas Visualisation) part of the presentation)
Data Analysis on ECOMMERCE PURCHASE
Various Data plots using Matplotlib and Seaborn
libraries and other public utilities
Using public libraries like GMPLOT
Introduction to print() Function in Python
3. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 3
Summary from the âEcommerce Purchaseâ Dataset
The data is predominently a list of purchases from the E-commerse site by a
corporate users
The analysis shows, who bought the most
What professions use this site and to purchase what
What kind of browsers and what kind of Machines they use.
We have also tried to analyse, if the cost of servicing is more for certain states
(least user base)
All the analysis is shown using the graphs.
4. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 4
Which card is being used the most by the customers
Based on this data, the merchant
can decide and promote certain user
base based on the card types,
like the example of offer on HDFC
cards in India (Here they can offer
discounts or tie up with the certain
card companies to increase the
base.
df['CC Provider'].value_counts().plot(kind='pie',autopct='%1.1f%%')
plt.show()
df['CC Provider'].value_counts().plot(kind='bar')
plt.show()
Code snippet
5. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 5
Who are the frequent visitors and who logs in least
Designers, Lawyers are the top 2
people, who visit the site for purchase
Who visit the least
highOcc=df.groupby('Job').sum()['Purchase
Price'].sort_values(ascending=False).head(10)
Code snippet
6. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 6
75% of the cards in the commerce site have expired
chart=sns.countplot(df['CC Exp Date']<"09/20")
Code snippet
The payments/repeat orders on the cards
stored in the
E-commerce may not work as the cards
have expired.
This clearly shows that the frequency of
the users is less
This can also lead to the reduced sales in
the upcoming period
7. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 7
The site should serve the top buying companies
Top 5 companies in terms of purchase
Brown Ltd 15
Smith Group 15
Smith PLC 13
Smith LLC 13
Willia ms LLC 12
Brown Limited and
its spread on cards
the employees use.
Smith Group and its
spread on cards the
employees use.
Code snippet
8. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 8
Technological setup of the users (Promotions strategy)
Code snippet : l1 = df['Browser Info'].str.count('Linux').value_counts()[1]
w1 = df['Browser Info'].str.count('Windows').value_counts()[1]
m1 = df['Browser Info'].str.count('Mac').value_counts()[1]
x = ('Linux','Windows','Mac')
y = (l1,w1,m1)
plt.bar(x,y)
df.loc[df['Browser Info'].str.split('/').str.len() > 1, 'Browser Type'] = df['Browser Info'].str.split('/').str[0]
plt.figure(figsize=(10,6))
Code snippet :
9. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 9
Google Map interface to show the least purchases
The code requires GOOGLE MAP API key, We are directly importing the ïŹle
genrated during the development as this involved cost
Code snippet :
import googlemaps, gmplot, webbrowser, os, json
apikey = '' # Add your google map API key
gmaps = googlemaps.Client(key=apikey) # Instantiating a google map
gmap = gmplot.GoogleMapPlotter.from_geocode('SC, US' , apikey=apikey)
print(type(Lowest_Buying_Cities))
for i in Lowest_Buying_Cities.index:
geocode_result = gmaps.geocode(i)
geom = geocode_result[0]['geometry']
loc = geom['location']
lat = loc['lat']
lng = loc['lng']
hidden_gem_lat, hidden_gem_lon = lat,lng
gmap.marker(hidden_gem_lat, hidden_gem_lon, 'red',title=i,label=i)
# Draw
gmap.draw("Lowest_Buying_Cities.html")
10. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 10
PRINT() Function in Python - Team 2
print(), when called simply throws the cursor to the next line means, a blank line will be displayed
Print(âstringâ)
Example Output
print() Prints the ânâ character
print(âHelloâ) Hello
print(âHelloâ) Hello
print(âHello n Worldâ) Hello
World
print(âHello t World Hello World
print(âHello n Worldâ) Hello n World
print(3* âHelloâ) HelloHelloHello
print(âHelloâ+âWorldâ) HelloWorld
print(âHelloâ,âWorldâ) Hello World
Print(variable list)
Example Output
a, b = 1, 2
print (a,b)
1 2
print(a,b, sep=â,â) 1,2
print(a,b, sep=â:â) 1:2
print(a,b, sep=â- - - â 1 - - - 2
print(âHelloâ, end=â â)
print(âWorldâ) HelloWorld
print(âHelloâ, end=âtâ)
print(âWorldâ)
Hello World
11. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 11
Print(object)
Example Output
list=[10,âAâ,âHaiâ]
print(list)
[10, âAâ, âHaiâ]
d = {10:âRamâ, 20:âAmarâ}
print(d)
{10:âRamâ, 20:âAmarâ}
PRINT() Function in Python - Team 2 continued
Print(âStringâ, variable list)
Example Output
a=2
print(a,â: Even Numberâ)
print(âYou typedâ, a,âas inputâ)
2 : Even Number
You typed 2 as input
12. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 12
PRINT() Function in Python - Team 2 continued
Print(formatted string) Syntax: print(âformatted stringâ % (variable list))
Example Output
a = 10
print("The value of a: %i" % a)
The value of a: 10
a, b = 10, 20
print("a: %dtb: %d" % (a, b))
a: 10 b: 20
name = "Ram"
print("Hai %s" % name)
print("Hai (%20s)" % name)
print("Hai (%-20s)" % name)
Hai Ram
Hai ( Ram)
Hai (Ram )
print("%c" % name[2]) m
print("%s" % name[0:2]) Ra
num = 123.345727
print("Num: %f" % num)
print("Num: %8.2f" % num)
Num: 123.345727
Num: 123.35
13. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 13
Print(formatted string)
PRINT() Function in Python - Team 2 continued
Example output
a, b, c = 1, 2, 3
print("First= {0}". format(a))
print("First= {0}, Second= {1}". format(a, b))
print("First= {one}, Second= {two}". format(one=a, two=b))
print("First= {}, Second= {}". format(a, b))
First= 1
First= 1, Second= 2
First= 1, Second= 2
First= 1, Second= 2
name, salary = "Ram", 123.45
print("Hello {0}, your salary: {1}". format(name, salary))
print("Hello {n}, your salary: {s}". format(n=name, s=salary))
print("Hello {:s}, your salary: {:.2f}". format(name, salary))
print("Hello %s, your salary: %.2f" % (name, salary))
Hello Ram, your salary: 123.45
Hello Ram, your salary: 123.45
Hello Ram, your salary: 123.45
Hello Ram, your salary: 123.45
Syntax: print("formatted string" % (varaible list))
14. Team 2 : MTech Project Presentation (Chethan, Chandra, Divyamsh and Nagabhushan) 14
APPENDIX
16. Python Libraries for Data Science
Many popular Python toolboxes/libraries:
âą NumPy
âą Pandas
Visualization libraries
âą matplotlib
âą Seaborn
and many more âŠ
16
All these libraries are
installed on the SCC
#Import Python Libraries
import numpy as np
import pandas as pd
import matplotlib as mpl
import seaborn as sns
17. Python Libraries for Data Science
NumPy:
âȘ introduces objects for multidimensional arrays and matrices, as well as
functions that allow to easily perform advanced mathematical and statistical
operations on those objects
âȘ provides vectorization of mathematical operations on arrays and matrices
which significantly improves the performance
âȘ many other python libraries are built on NumPy
17
18. Python Libraries for Data Science
Pandas:
âȘ adds data structures and tools designed to work with table-like data (similar to
Series and Data Frames in R)
âȘ provides tools for data manipulation: reshaping, merging, sorting, slicing,
aggregation etc.
âȘ allows handling missing data
18
Link: http://pandas.pydata.org/
19. matplotlib:
âȘ python 2D plotting library which produces publication quality figures in a
variety of hardcopy formats
âȘ a set of functionalities similar to those of MATLAB
âȘ line plots, scatter plots, barcharts, histograms, pie charts etc.
âȘ relatively low-level; some effort needed to create advanced visualization
Link: https://matplotlib.org/
Python Libraries for Data Science
19
20. Seaborn:
âȘ based on matplotlib
âȘ provides high level interface for drawing attractive statistical graphics
âȘ Similar (in style) to the popular ggplot2 library in R
Link: https://seaborn.pydata.org/
Python Libraries for Data Science
20