• Tel: +254 795 797 328
  • hebifa.rafiki@cti.co.ke
  • Online AI & Tech Community
  • Become An Instructor

python for data visualization Written by william.morara

Category: Python  /  Created: 02/26/2024 23:12:54

You may have heard or said to someone that you remember them by face but you cannot recall their name. That is the power of visualization, people tend to remember what they see more. This same thing applies to Data and visualizations people tend to remember more about the visualizations. That’s why software like Tableau and Power BI are specifically designed for data visualizations.

Some people call data visualizations the heart of data or giving data life. Going by this analogy, for visualizations to be able to achieve their aim or goal they need to be placed correctly. A heart can only perform if it is in its correct space. There exist many types of visualizations and for a specific visualization to be impactful, it has to be used correctly.

IBM an international technology company defines data visualization as the representation of data through the use of common graphics, such as charts, plots, infographics, and even animations. These visual displays of information communicate complex data relationships and data-driven insights in a way that is easy to understand.

Python, is a software used for many purposes, including data science and data analysis and working on data for insights. Hence combining this software with visualization is an advantage. Python has libraries such as Matplotlib, seaborn, and Plotly that can be used for data visualization.

We will cover some common types of data visualization, their use, and how to plot them in Python using various libraries. I hope you learn and practice.

Line Graph

USE: to show trends, developments, or changes over time.

EXAMPLE: Daily, Weekly, monthly and annual company sales.

DATA: Numerical data over time.

Pie Chart

USE: to represent parts of a whole.

EXAMPLE: percentage of different types of food crops grown on a farm.

DATA: Categorical data.

Bar Chart

USE: to show the comparison of different categories.

EXAMPLE: number of students and their preferred meal.

DATA: Categorical or numeric data in categories.

Histogram

USE: to show how frequently numerical values occur.

EXAMPLE: Distribution of different age groups in a country.

DATA: Numeric data representing one variable.

Scatter Plot

USE: to show the relationship between two variables.

EXAMPLE: Number of games played by a player and their scores.

DATA: Numerical data representing more than one variable, that have some relationship.

Heat Maps

USE: to represent values by use of colors.

EXAMPLE: Most preferred region to invest.

DATA: Numeric data

Box-and-Whisker Plots

USE: to provide a numeric summary of variables visually, it can also be used to detect outliers.

EXAMPLE: Detecting the outlier value of student performance.

DATA: Numeric data but for a single variable.

Word clouds

USE: to show the occurrence and distribution of text data.

EXAMPLE: Most occurring words in a book or comment section.

DATA: Text data

To view the Python notebook with each of this visualization click https://github.com/williamm243/Data-visualization/blob/main/visualization.ipynb

Always remember the choice of visualization depends on the variable and the type of data, therefore understanding the variables is key to getting the best visualization. Always choose the visualization that best suits your data and communicates effectively.

For this and similar conversations and collaboration on data analysis and data visualizations, you can reach out to me via;

Email: williammorara28@gmail.com

Phone: +254710489328

LinkedIn: https://www.linkedin.com/in/william-morar