Member-only story
If you are going to go to an interview in one of the data science roles, you could very well be asked to demonstrate your skill in this area. For instance, you may be asked to create a simple line plot. A sample question could be:-
Create a simple line plot where X and y axis range from 1 to 10. Label the X and y axis as ‘X-axis’ and ‘y-axis’.
While this task may not seem simple to someone who has not been programming in Python for long, it is simple compared to some of the other graphs that could be produced.
I have devised three ways that the interview question can be answered, using:-
- Lists
- Numpy arrays,
- Numpy’s linspace, and
- Pandas’ dataframe.
One library that will be essential for plotting a simple graph is Matplotlib. Matplotlib, originally developed by John D Hunter, is a plotting library for the Python programming language and its numerical mathematics extension NumPy.
Another library that can be used to plot graphs is numpy. NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays. The predecessor of…