Tag: certain
Python : How to remove files by matching pattern | wildcards | certain extensions only ?
In this article we will discuss how to delete few files from a directory based on matching pattern or wildcard. Suppose we have a directory that contains some log files and some text files and we want to delete all .txt files from that directory i.e. files that ends with string “.txt”. Let’s discuss how …
Python : How to remove files by matching pattern | wildcards | certain extensions only ?Read More
Pandas : Loop or Iterate over all or certain columns of a dataframe
In this article we will different ways to iterate over all or certain columns of a Dataframe. Let’s first create a Dataframe i.e. # List of Tuples empoyees = [(‘jack’, 34, ‘Sydney’) , (‘Riti’, 31, ‘Delhi’) , (‘Aadi’, 16, ‘New York’) , (‘Mohit’, 32,’Delhi’) , ] # Create a DataFrame object empDfObj = pd.DataFrame(empoyees, columns=[‘Name’, …
Pandas : Loop or Iterate over all or certain columns of a dataframeRead More
Python : Count elements in a list that satisfy certain conditions
In this example we will discuss 4 different ways to count number of elements in a list that satisfy certain conditions. Suppose we have a list of numbers i.e. Advertisements # List of numbers listOfElems = [11, 22, 33, 45, 66, 77, 88, 99, 101] We want to count number of elements in the list …
Python : Count elements in a list that satisfy certain conditionsRead More
Pandas: Sum rows in Dataframe ( all or certain rows)
In this article we will discuss how to sum up rows in a dataframe and add the values as a new row in the same dataframe. First of all, we will create a Dataframe, Advertisements import pandas as pd import numpy as np # List of Tuples employees_salary = [(‘Jack’, 2000, 2010, 2050, 2134, 2111), …
Pandas: Sum rows in Dataframe ( all or certain rows)Read More
Javascript: Remove everything after a certain character
At times we need to do certain operations on strings while working in javascript, and one such requirement is to remove everything after a specific character in a string. Table of Contents:- Javascript remove everything after a certain character using split() Javascript remove everything after a certain character using substring() Javascript remove everything after a …
Javascript: Remove everything after a certain characterRead More
Check if a string contains certain characters in C++
In this article, we will discuss different ways to check if a string contains certain characters or not. Suppose we have a sequence of characters like, vector vecOfChars{‘s’, ‘a’, ‘i’}; We want to check if a given string contains all of these characters or not. Let’s see how to do this, Advertisements Check if a …
Check if a string contains certain characters in C++Read More
Get DataFrame Rows whose column has a certain value
Several times, we need to extract out the rows where the columns match certain values. In this article, we will discuss different ways to achieve that. Table of Contents Introduction Get rows whose column matches a value Using loc[] Get rows whose column matches a value Using where() method from Numpy Get rows whose column …
Get DataFrame Rows whose column has a certain valueRead More
Create Empty List with certain size in Python
In this article, we will discuss different ways to create an empty list with certain size. Table Of Contents Introduction Create an empty list with certain size using astrik Create an empty list with certain size using List Comprehension Summary Introduction An empty list of size N means, that list will contain N None values. …
Remove certain characters from a String in C++
In this article, we will learn how to remove certain characters from a string in C++. Table Of Contents Problem Description Method 1: Using while loop Method 2: Using STL function for_each(), erase() and remove() Special Notes about remove() and erase() Summary Problem Description Suppose we have a string sampleStr, and an array of characters …
How to Block a Website visitors from certain countries using Nginx GeoIP
Prerequisites Your Compute Engine Instance running. For setting up Compute Engine, see the Setting up Compute Engine Instance. For installing Nginx and PHP, see how to install LEMP in Compute Engine Instance. Domain name is pointed to your virtual machine. Learn how to Set up Google Cloud DNS for your domain. Block using GeoIP With …
How to Block a Website visitors from certain countries using Nginx GeoIPRead More