Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Follow publication

Data visualization using Pandas

Jayashree domala
Nerd For Tech
Published in
4 min readDec 10, 2020

--

How to import the packages?

>>> import numpy as np
>>> import pandas as pd
>>> %matplotlib inline
>>> df1 = pd.read_csv('dataset2.csv')
>>> df1.head()

How to create a histogram plot?

>>> df1['b'].hist(bins=15)
>>> import seaborn as sns
>>> sns.set_style('whitegrid')
>>> df1['b'].hist(bins=15)

How to deal with general plot kinds?

>>> df1['c'].plot(kind='hist',bins=10)
>>> df1['c'].plot.hist()

How to create area plots?

>>> df1.plot.area(alpha=0.7)

How to create bar plots?

>>> df1.plot.bar()
>>> df1.plot.bar(stacked=True)

How to create line plots?

>>> df1.plot.line(y='d')
>>> df1.plot.line(y='a',figsize=(5,3),lw=2)

How to create scatter plots?

>>> df1.plot.scatter(x='b',y='d')
>>> df1.plot.scatter(x='b',y='d',c='a',cmap='rainbow')

How to create box plots?

>>> df1.plot.box()

How o create hex plots?

>>> df1.plot.hexbin(x='b',y='d',gridsize=15)

How to create KDE plot?

>>> df1['d'].plot.kde()
>>> df1.plot.kde()

For more detailed information on Pandas data visualization, check the official documentation here.

Refer to the notebook for code here.

Books to refer to:

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Nerd For Tech
Nerd For Tech

Published in Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Jayashree domala
Jayashree domala

Written by Jayashree domala

Self-driven woman who wishes to deliver creative and engaging ideas and solutions in the field of technology.

No responses yet

Write a response