Pradeep Elance has Published 445 Articles

Python - Filter the negative values from given dictionary

Pradeep Elance

Pradeep Elance

Updated on 07-Jan-2020 06:48:05

347 Views

As part of data analysis, we will come across scenarios to remove the negative values form a dictionary. For this we have to loop through each of the elements in the dictionary and use a condition to check the value. Below two approaches can be implemented to achieve this.Using for ... Read More

Python - Filter even values from a list

Pradeep Elance

Pradeep Elance

Updated on 07-Jan-2020 06:46:30

1K+ Views

As part of data analysis require to filter out values from a list meeting certain criteria. In this article we'll see how to filter out only the even values from a list.We have to go through each element of the list and divide it with 2 to check for the ... Read More

Multiplication of two Matrices in Single line using Numpy in Python

Pradeep Elance

Pradeep Elance

Updated on 07-Jan-2020 06:41:16

552 Views

Matrix multiplication is a lengthy process where each element from each row and column of the matrixes are to be multiplied and added in a certain way. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the second matrix. ... Read More

All possible permutations of N lists in Python

Pradeep Elance

Pradeep Elance

Updated on 07-Jan-2020 06:34:45

768 Views

If we have two lists and we need to combine each element of the first element with each element of the second list, then we have the below approaches.Using For LoopIn this straight forward approach we create a list of lists containing the permutation of elements from each list. we ... Read More

Why should eval be avoided in Bash, and what should I use instead?

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 07:23:05

1K+ Views

eval is a builtin command of the Bash shell which concatenates its arguments into a single string. Then it joins the arguments with spaces, then executes that string as a bash command. Below is an example of how it works.eval exampleIn the below example we take a string which has ... Read More

Looping through the content of a file in Bash

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 07:15:52

6K+ Views

Often it is a requirement to read each of the line from a file using a bash script. There are various approaches to read the lines form a file. In the below example we have first described how to create a sample file and then run a script reading that ... Read More

How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script?

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 07:12:22

1K+ Views

When we transfer files between Windows and Unix systems, often we come across with issue relating to the end of line character. This is because the EOL character in windows is not recognized as a EOL character in Unix. SO to fix this issue when a file is transferred from ... Read More

How to Search and Remove Directories Recursively on Linux?

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 07:02:23

275 Views

Removing directories is a regular process for anyone working on Unix systems.But sometimes we also need to find the directories first and then decide to delete it. One hurdle in deleting the files is to do a recursive deleting because by default Unix systems do not allow deleting of a ... Read More

How to Save Command Output to a File in Linux?

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 07:00:58

454 Views

Sometimes the output of Unix command can we learn the important in such case we want to save the result for later reference in this article we will see how to save the output of a command to a file.Creating a New FileOutput of the disk usage command can be ... Read More

How to Re-run Last Executed Commands in Linux?

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 06:59:07

219 Views

Re-running commands in the command line is a regular task which all of us go through when working on the Unix systems. In the below article we will see various ways how we can rerun the commands we have already executed this helps save time and it helps reasoning longer ... Read More

Advertisements