Pradeep Elance has Published 417 Articles

Absolute Deviation and Absolute Mean Deviation using NumPy

Pradeep Elance

Pradeep Elance

Updated on 03-Jul-2020 07:47:01

1K+ Views

In Statistical analysis study of data variability in a sample indicates how dispersed are the values in a given data sample. The two important ways we calculate the variability are Absolute Deviation and  Mean Absolute Deviation.Absolute DeviationIn this method we first find the mean value of the given sample and ... Read More

Absolute and Relative frequency in Pandas

Pradeep Elance

Pradeep Elance

Updated on 03-Jul-2020 07:45:19

837 Views

In statistics, the term "frequency" indicates the number of occurrences of a value in a given data sample. As a software meant for mathematical and scientific analysis, Pandas has many in-built methods to calculate frequency from a given sample.Absolute Frequency It is same as just the frequency where the number ... Read More

Accessing elements of a Pandas Series

Pradeep Elance

Pradeep Elance

Updated on 30-Jun-2020 08:51:33

11K+ Views

Pandas series is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.). The elements of a pandas series can be accessed using various methods.Let's first create a pandas series and then access it's elements.Creating Pandas SeriesA panadas series is created by supplying ... Read More

Accessing Attributes and Methods in Python

Pradeep Elance

Pradeep Elance

Updated on 30-Jun-2020 08:49:39

14K+ Views

As an object oriented programming language python stresses on objects. Classes are the blueprint from which the objects are created. Each class in python can have many attributes including a function as an attribute.Accessing the attributes of a classTo check the attributes of a class and also to manipulate those ... Read More

Add new column in Pandas Data Frame Using a Dictionary

Pradeep Elance

Pradeep Elance

Updated on 30-Jun-2020 08:46:10

1K+ Views

Pandas Data Frame is a two-dimensional data structure, i.e., data is aligned in a tabular fashion in rows and columns. It can be created using python dict, list, and series etc. In this article, we will see how to add a new column to an existing data frame.So first let's ... Read More

a.sort, sorted(a), np_argsort(a) and np.lexsort(b, a) in Python

Pradeep Elance

Pradeep Elance

Updated on 30-Jun-2020 08:34:19

690 Views

Ordering of data elements in a specific order is a frequently needed operation. To sort elements in an array, python uses the functions named sorted() and array.sort().sorted(array)This function returns a sorted array without modifying the original array.a = [9, 5, 3, 1, 12, 6] b = sorted([9, 5, 3, 1, ... Read More

Heap queue (or heapq) in Python

Pradeep Elance

Pradeep Elance

Updated on 09-Jun-2020 13:17:18

5K+ Views

Heap queue is a special tree structure in which each parent node is less than or equal to its child node. In python it is implemented using the heapq module. It is very useful is implementing priority queues where the queue item with higher weight is given more priority in ... Read More

Get match indices in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Jun-2020 12:27:24

583 Views

Two lists are given. We need to find the index of the elements from the first list whose values match with the elements in the second list.With indexWe simply design follow to get the value of the element in the second list and extract the corresponding index from the first ... Read More

Get last N elements from given list in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Jun-2020 12:25:14

1K+ Views

Given a Python list we want to find out only e e the last few elements.With slicingThe number of positions to be extracted is given. Based on that we design is slicing technique to slice elements from the end of the list by using a negative sign.Example Live DemolistA = ['Mon', ... Read More

Get key with maximum value in Dictionary in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Jun-2020 12:22:34

770 Views

A Python dictionary contains key value pairs. In this article we will see how to get the key of the element whose value is maximum in the given Python dictionary.With max and getWe use the get function and the max function to get the key.Example Live DemodictA = {"Mon": 3, "Tue": ... Read More

Advertisements