Pradeep Elance has Published 445 Articles

How to Count Word Occurrences in a Text File using Shell Script?

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 06:29:40

8K+ Views

Linux shell scripting has many powerful tools to process the data in files. One such feature is to find patterns and count the number of occurrences of matched patterns. One such example is to count the number of occurrences of a specific word in a given file. This is achieved ... Read More

How to Count Number of Files and Subdirectories inside a Given Linux Directory?

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 06:27:19

3K+ Views

It often becomes essential to know not just the count of files in my current directory but also the count of files from all the subdirectories inside the current directory. This can be found out using theUsing lswe can use ls to list the files, then choose only the ones ... Read More

Create Shortcuts to Long and Complicated Paths in Linux (Gogo)

Pradeep Elance

Pradeep Elance

Updated on 03-Jan-2020 06:20:28

87 Views

Gogo is a tool to bookmark directories with long and complicated paths in the Unix shell. Because the long parts are difficult to remember and cumbersome to type in. In this article we'll see how to install go go and use it.Installing gitWe first need to have git installed in ... Read More

Python - Column summation of tuples

Pradeep Elance

Pradeep Elance

Updated on 02-Jan-2020 10:26:34

193 Views

Python has extensive availability of various libraries and functions which make it so popular for data analysis. We may get a need to sum the values in a single column for a group of tuples for our analysis. So in this program we are adding all the values present at ... Read More

Python - Change column names and row indexes in Pandas DataFrame

Pradeep Elance

Pradeep Elance

Updated on 02-Jan-2020 10:23:35

2K+ Views

Pandas is a python library offering many features for data analysis which is not available in python standard library. One such feature is the use of Data Frames. They are rectangular grids representing columns and rows. While creating a Data frame, we decide on the names of the columns and ... Read More

max() and min() in Python

Pradeep Elance

Pradeep Elance

Updated on 02-Jan-2020 10:16:18

2K+ Views

Finding maximum and minimum values from a given list of values is a very common need in data processing programs. Python has these two functions which handle both numbers and strings. We will see both the scenarios in the below examples.Numeric ValuesWe take a list of numeric values which has ... Read More

Getter and Setter in Python

Pradeep Elance

Pradeep Elance

Updated on 02-Jan-2020 10:13:52

11K+ Views

For the purpose of data encapsulation, most object oriented languages use getters and setters method. This is because we want to hide the attributes of a object class from other classes so that no accidental modification of the data happens by methods in other classes.As the name suggests, getters are ... Read More

Fractal Trees in Python

Pradeep Elance

Pradeep Elance

Updated on 02-Jan-2020 10:07:38

715 Views

Fractal patterns are all around us in nature. Like a small branch taken out of the leaf of a fern leaf resembles the leaf itself. Or a pebble often resembles the shape of a mountain! So this idea of a repetition of small pattern to generate a large pattern is ... Read More

Decision tree implementation using Python

Pradeep Elance

Pradeep Elance

Updated on 02-Jan-2020 10:01:51

1K+ Views

Decision tree is an algorithm which is mainly applied to data classification scenarios. It is a tree structure where each node represents the features and each edge represents the decision taken. Starting from the root node we go on evaluating the features for classification and take a decision to follow ... Read More

assert keyword in Python

Pradeep Elance

Pradeep Elance

Updated on 02-Jan-2020 09:51:34

162 Views

Every programming language has feature to handle the exception that is raised during program execution. In python the keyword assert is used to catch an error and prompt a user defined error message rather than a system generated error message. This makes it easy for the programmer to locate and ... Read More

Advertisements