0% found this document useful (0 votes)
73 views9 pages

Data Visualization - Ipynb - Colab

The document contains a Jupyter notebook for data visualization using Python, specifically with the Pandas and Plotly libraries. It includes loading datasets related to loan applications and stock prices, and visualizing relationships between applicant income and loan amounts, as well as stock performance metrics. Various dataframes are created and visualizations are generated to analyze the data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views9 pages

Data Visualization - Ipynb - Colab

The document contains a Jupyter notebook for data visualization using Python, specifically with the Pandas and Plotly libraries. It includes loading datasets related to loan applications and stock prices, and visualizing relationships between applicant income and loan amounts, as well as stock performance metrics. Various dataframes are created and visualizations are generated to analyze the data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

10/22/24, 3:02 PM data visualization.

ipynb - Colab

import pandas as pd

df=pd.read_csv("https://docs.google.com/spreadsheets/d/144-71CfGkGwDxj69JIkOan7PUD9A1jHnG

df

Loan_ID Gender Education ApplicantIncome LoanAmount Loan_Amount_Term

0 LP001015 Male Graduate 5720 110 360

1 LP001022 Male Graduate 3076 126 360

2 LP001031 Male Graduate 5000 208 360

3 LP001035 Male Graduate 2340 100 360

Not
4 LP001051 Male 3276 78 360
Graduate

Not
5 LP001054 Male 2165 152 360
Graduate

Not
6 LP001055 Female 2226 59 360
Graduate

Not
7 LP001056 Male 3881 147 360
Graduate

8 LP001059 Male Graduate 13633 280 240

Not
9 LP001067 Male 2400 123 360
Graduate

Not
10 LP001078 Male 3091 90 360
Graduate

11 LP001082 Male Graduate 2185 162 360

12 LP001083 Male Graduate 4166 40 180

13 LP001094 Male Graduate 12173 166 360

14 LP001096 Female Graduate 4666 124 360

15 LP001099 Male Graduate 5667 131 360

16 LP001105 Male Graduate 4583 200 360

17 LP001107 Male Graduate 3786 126 360

18 LP001108 Male Graduate 9226 300 360

19 LP001115 Male Graduate 1300 100 180

Next steps: Generate code with df


toggle_off View recommended plots New interactive sheet

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 1/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

import plotly.express as px

px.scatter(df,x="ApplicantIncome",y="LoanAmount")

300

250

200
LoanAmount

150

100

50

2k 4k 6k

px.scatter(x=df["ApplicantIncome"],y=df["LoanAmount"],color=df['Education'])

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 2/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

300

250

200
y

150

100

50

2k 4k 6k

df2=pd.read_csv("https://docs.google.com/spreadsheets/d/1IqgbaSNNr_lFj7Fvvwl3FLIm1pa5phgz

df2

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 3/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

Last Prev %
Company Name High Low Change
Price Close Loss

Manappuram
0 147.15 141 141.13 146.9 -64.35 -31.32
Fin

1 IEX 187.82 181.52 181.92 187.11 -49.43 -21.37

2 RBL Bank 178.58 168.1 169.27 176.14 -43.57 -20.47

3 Mahanagar Gas 1,597.90 1,525.20 1,541.60 1,566.55 -363.05 -19.06

4 Vodafone Idea 8.73 8.47 8.5 8.5 -1.97 -18.82

5 IGL 450.85 439.65 439.9 443.15 -99.00 -18.37

6 Indiamart Inter 2,572.35 2,486.65 2,500.00 2,508.60 -555.10 -18.17

TATA Cons.
7 1,023.85 994.50 999.60 1,017.05 -217.25 -17.85
Prod

8 L&T Finance 159.19 148.5 149.17 157.82 -32.14 -17.73

9 Dabur India 571.75 556.2 557.5 568.2 -110.05 -16.49

10 Bandhan Bank 184.9 175 175.66 184.89 -34.38 -16.37

11 GMR Airports 84.51 79.79 80.61 82.96 -13.92 -14.73

12 Aarti Ind 510.95 491.1 494.6 510.25 -79.20 -13.80

13 IndusInd Bank 1,312.20 1,275.00 1,278.00 1,308.25 -202.20 -13.66

14 Hero Motocorp 5,274.40 5,155.00 5,202.00 5,242.25 -811.25 -13.49

15 Berger Paints 559.6 540 541.05 556.65 -81.80 -13.13

16 Havells India 1,819.45 1,778.50 1,780.60 1,812.70 -267.50 -13.06


Next
steps:
Generate code
with
df2
toggle_off View recommended
plots
New interactive
sheet

px.line(x=df2['Company Name'],y=df2['% Loss'])

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 4/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

−15

−20
y

−25

−30

Ma IE RB Ma Vo IG In TA
na X LB ha d afo L dia TA
pp an n ag ne ma Co
ur k ar rt ns
am Ga Id In .
Fin ea ter
s

df3=pd.read_csv("https://docs.google.com/spreadsheets/d/1IqgbaSNNr_lFj7Fvvwl3FLIm1pa5phgz

df3

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 5/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

Last Prev %
Company Name High Low Change
Price Close Loss

Manappuram
0 147.15 141 141.13 146.9 -64.35 -31.32
Fin

1 IEX 187.82 181.52 181.92 187.11 -49.43 -21.37

2 RBL Bank 178.58 168.1 169.27 176.14 -43.57 -20.47

3 Mahanagar Gas 1,597.90 1,525.20 1,541.60 1,566.55 -363.05 -19.06

4 Vodafone Idea 8.73 8.47 8.5 8.5 -1.97 -18.82

5 IGL 450.85 439.65 439.9 443.15 -99.00 -18.37

6 Indiamart Inter 2,572.35 2,486.65 2,500.00 2,508.60 -555.10 -18.17

TATA Cons.
7 1,023.85 994.50 999.60 1,017.05 -217.25 -17.85
Prod

8 L&T Finance 159.19 148.5 149.17 157.82 -32.14 -17.73

9 Dabur India 571.75 556.2 557.5 568.2 -110.05 -16.49

10 Bandhan Bank 184.9 175 175.66 184.89 -34.38 -16.37

11 GMR Airports 84.51 79.79 80.61 82.96 -13.92 -14.73

12 Aarti Ind 510.95 491.1 494.6 510.25 -79.20 -13.80

13 IndusInd Bank 1,312.20 1,275.00 1,278.00 1,308.25 -202.20 -13.66

14 Hero Motocorp 5,274.40 5,155.00 5,202.00 5,242.25 -811.25 -13.49

15 Berger Paints 559.6 540 541.05 556.65 -81.80 -13.13

16 Havells India 1,819.45 1,778.50 1,780.60 1,812.70 -267.50 -13.06


Next
steps:
Generate code
with
df3
toggle_off View recommended
plots
New interactive
sheet

high=df3['High'].sum()

low=df3['Low'].sum()

lp=df3['Last Price'].sum()

px.bar(x=['High','Low','Last Price'],y=[high,low,lp])

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 6/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

141.13181.92169.271,541.608.5439.92,500.00999.60149.17557.5175.6680.61494.61,278.005,

141181.52168.11,525.208.47439.652,486.65994.50148.5556.217579.79491.11,275.0
y

147.15187.82178.581,597.908.73450.852,572.351,023.85159.19571.75184.984.51510.951,312.205

df4=pd.read_csv("https://docs.google.com/spreadsheets/d/1SUUZpF9uUiKDR4rq4ZtVZZgdVAlLnvfS

df4

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 7/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

Loan_ID Gender Married Education Self_Employed ApplicantIncome LoanAmount

0 LP001015 Male Yes Graduate No 5720 110

1 LP001022 Male Yes Graduate No 3076 126

2 LP001031 Male Yes Graduate No 5000 208

3 LP001035 Male Yes Graduate No 2340 100

Not
4 LP001051 Male No No 3276 78
Graduate

Not
5 LP001054 Male Yes Yes 2165 152
Graduate

Not
6 LP001055 Female No No 2226 59
Graduate

Not
7 LP001056 Male Yes No 3881 147
Graduate

8 LP001059 Male Yes Graduate NaN 13633 280

Not
9 LP001067 Male No No 2400 123
Graduate

Not
10 LP001078 Male No No 3091 90
Graduate

11 LP001082 Male Yes Graduate NaN 2185 162

12 LP001083 Male No Graduate No 4166 40

13 LP001094 Male Yes Graduate NaN 12173 166

14 LP001096 Female No Graduate No 4666 124

15 LP001099 Male No Graduate No 5667 131

16 LP001105 Male Yes Graduate No 4583 200

17 LP001107 Male Yes Graduate No 3786 126

18 LP001108 Male Yes Graduate No 9226 300

19 LP001115 Male No Graduate No 1300 100

Next
steps:
Generate code
with
df4
toggle_off View recommended
plots
New interactive
sheet

px.histogram(x=df4['Education'],color=df4['Gender'])

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 8/9
10/22/24, 3:02 PM data visualization.ipynb - Colab

14

12

10

8
count

df4
0
Graduate
Loan_ID Gender Married Education Self_Employed ApplicantIncome LoanAmount

0 LP001015 Male Yes Graduate No 5720 110

1 LP001022 Male Yes Graduate No 3076 126

2 LP001031 Male Yes Graduate No 5000 208

https://colab.research.google.com/drive/1zmItTTkuNgrV9Z3UzyOEAGxvBfAxV9-J#scrollTo=KvScTwDbfz5n&printMode=true 9/9

You might also like