Uncategorized

Matplotlib Pyplot

Matplotlib Pyplot   The pyplot object is the main workhorse of matplotlib library. It is through pyplot that you can create the figure canvas, various types of plots, modify and decorate them. Contents Pyplot: Basic Overview General Functions in pyplot Line plot Scatter plot Pie chart Histogram 2D Histograms Bar plot Stacked Barplot Boxplot Stackplot Time series …

Python Example – Write a Python program to remove duplicates from a list of lists

(Python Example for Citizen Data Scientist & Business Analyst)   Write a Python program to remove duplicates from a list of lists.   Sample Solution Python Code: import itertools num = [[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]] print(“Original List”, num) num.sort() new_num = list(num for num,_ in itertools.groupby(num)) print(“New List”, new_num) …

Python Example – Write a Python program to find the available built-in modules

(Python Example for Citizen Data Scientist & Business Analyst)   Write a Python program to find the available built-in modules. Sample Solution Python Code: import sys import textwrap module_name = ‘, ‘.join(sorted(sys.builtin_module_names)) print(textwrap.fill(module_name, width=70)) Sample Output: _ast, _bisect, _codecs, _collections, _datetime, _elementtree, _functools, _heapq, _imp, _io, _locale, _md5, _operator, _pickle, _posixsubprocess, _random, _sha1, _sha256, _sha512, …

Python tutorials for Business Analyst – Python datetime

(Python Tutorial – 043) Python datetime In this article, you will learn to manipulate date and time in Python with the help of examples. Python has a module named datetime to work with dates and times. Let’s create a few simple programs related to date and time before we dig deeper.   Example 1: Get Current Date …