- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
In this article we will learn about Queue.LIFOQueue vs Collections.Deque in Python programming language. When we need to manage our data using the last in first out method then we can use these data structures. But to choose one of them we need to know about their functionalities and characteristics. Before that let’s get to know about Queue.LIFOQueue and Collections.Deque. LIFOQueue This class is part of the queue module. It works as stack data structure and it is considered as thread safe means we can talk between the different threads at the same time. Here are some specifications of ... Read More
In this article we will get to know how we can replace sublist value with new list. You may have faced this problem while working with manipulation of list. Here we will see various methods using which we can replace the sublist with other list. Let’s get to know this using below example − listItem = [1, 2, 3, 4, 5, 6] new_list = [7, 8, 9] Here we have list named as listItem which contains some elements and we have another list named as new_list. So, we want to replace the sublist of listItem with new_list. Take ... Read More
In this article we will learn how we can replace rear (word at the end of the string) word with any other given word. You may have seen this problem while doing manipulation of string. Here we will see various methods for replacing the rear word in string with given word. Let’s get to know this using below example − string_txt = "This cat is running very Fast" Here we have a string string_txt which contains sentences and we want to replace the last word which is "Fast" into "Slow" so that the resulting string will be like. ... Read More
In this article we will learn about replacement of punctuation with letter k in the string. You may have seen this problem while performing text processing or data cleaning task in the python where you need to replace punctuations with specific characters or any symbol. Here we will see various methods for replacing the punctuations with given text "k" Let’s get to know this using below example − string = "Welcome, to, * the website ! aliens" Here we have a string which contains punctuations like [, * !] and we want to replace that with text "k". ... Read More
In this article we will see method to replace negative values with zero. If we talk about data analysis then handling negative values is very crucial step to ensure meaningful calculation. So, here you will learn about various methods using which we can replace negative values with 0. Method 1. Using Traversal and List Comprehension. Example import numpy as np arr = np.array([-12, 32, -34, 42, -53, 88]) arr = [0 if x < 0 else x for x in arr] arr = np.array(arr) print("array with replaced values is: ", arr) Output array with replaced values ... Read More
In this article we will see method to replace NaN (Not a Number) value with the average of columns. If we talk about data analysis then handling NaN value is very crucial step. So, here you will learn about various methods using which we can replace NaN (Not a Number) value with the average of columns. Method 1: Using Numpy.nanmean(). Example import numpy as np arr = np.array([[1, 2, np.nan], [4, np.nan, 6], [np.nan, 8, 9]]) col_means = np.nanmean(arr, axis=0) arr_filled = np.where(np.isnan(arr), col_means, arr) print("Column mean: ", col_means) print("Final array: ... Read More
In this article we will see method to replace the multiple characters at once in any string. While working with programs where we face such situation when we will have to replace any particular character simultaneously at all of its occurences. Suppose a situation in which you have an article in which it contains one word named as “word” which is having multiple occurrences and you want to convert that “word” into “work” so you can do this manually but it is very bad practice of doing this work one by one. So, we will look at multiple methods using ... Read More
Entropy is a property of a thermodynamic system that remains constant during a reversible adiabatic process. Moreover, we can also say that it is the degree of randomness or disorder in the system. If a system exchanges dQ heat from its surroundings at temperature T, then the chance in the entropy can be written as − $$\mathrm{ds \: = \: \frac{dQ}{T} \dotso \dotso \: (1)}$$ According to Clausius' inequality the cyclic integral of $\mathrm{\frac{dQ}{T}}$ along a reversible path is either less or equal to zero. Mathematically, it can be written as − $$\mathrm{\oint\frac{dQ}{T} \: \leq \: 0\dotso \dotso \: (2)}$$ ... Read More
In this article we will learn how to replace any given list element with its ordinal number. We will see various methods to get this work done. Before that let’s know about ordinal numbers. Ordinal number − In mathematics we say ordinal number as number which represents the position or original order of list items present in a sequence. Take an example of a list: [ 6, 8, 5, 3 ] so ordinal value of these number would be − The first element (6) has ordinal value 1. The second element (8) has ordinal value 2. The third element ... Read More
In this article we will learn about the Jacobian matrix and how to calculate this matrix using different methods in PyTorch. We use Jacobian matrix in various machine learning applications. Jacobian Matrix We use Jacobian matrix to calculate relation between the input and output variable. Jacobian matrix has all the partial derivatives of vector valued function. We can use this matrix in various applications machine learning applications. Here are some of its usages − For analyzing the gradients and derivatives of functions in multivariable calculus. Solving differential equations of systems. Calculating inverse of vector-values functions. Analyzing stability of dynamic ... Read More