Tag: name
Select Rows & Columns by Name or Index in using loc & iloc
In this article we will discuss different ways to select rows and columns in DataFrame. DataFrame provides indexing labels loc & iloc for accessing the column and rows. Also, operator [] can be used to select columns. Let’s discuss them one by one, Advertisements First create a DataFrame object i.e. students = [ (‘jack’, 34, …
Select Rows & Columns by Name or Index in using loc & ilocRead More
Python : Check if a process is running by name and find it’s Process ID (PID)
In this article we will discuss a cross platform way to find a running process PIDs by name using psutil. To install python’s psutil library use, Advertisements pip install psutil Check if a process is running To check if process is running or not, let’s iterate over all the running process using psutil.process_iter() and match …
Python : Check if a process is running by name and find it’s Process ID (PID)Read More
Docker : How to Stop & Remove a running container by ID or Name ?
In this article we will discuss how to stop and remove a running container by filtering on ID and Name. To completely remove a running container, first we have to stop it and then remove it. Advertisements How to stop a running docker container ? Suppose we have a running container whose Status is ‘UP’ …
Docker : How to Stop & Remove a running container by ID or Name ?Read More
Pandas – Select Column by Name
In this article, we will discuss how to select a Dataframe column by name in pandas. Table of Contents Select Dataframe Column by name using [] Select Dataframe Column by name using loc[] Overview of df.loc[] Example of selecting Column by name using loc[] Suppose we have a dataframe df with following contents, Advertisements Name …
Pandas: Select multiple columns of dataframe by name
In this article, we will discuss different ways to select multiple columns of dataframe by name in pandas. Table of Contents Select multiple columns by name in pandas dataframe using [] Select multiple columns by name in pandas dataframe using loc[] Overview of df.loc[] Example of selecting multiple columns using loc[] Suppose we have a …
Pandas: Select multiple columns of dataframe by nameRead More
Python: Get list of files in directory sorted by name
In this article, we will discuss different ways to get list of all files in a directory / folder sorted by name in python. Table of contents Get list of files (file paths) in directory sorted by name. Get list of file names in directory sorted by name. Get list of files (file paths) in …
Python: Get list of files in directory sorted by nameRead More
Get Column Index from Column Name in Pandas DataFrame
In this article, we will discuss different ways to get the column index position from the name of column in a Pandas DataFrame. Table of Contents: Get column index from column name in DataFrame using get_loc() Get column index from column name in DataFrame using list() In Python, the Pandas module provides a data structure …
Get Column Index from Column Name in Pandas DataFrameRead More
How to Get a Function Name as a String in Python?
In this python tutorial, we will learn how to get a function name as a string. Table Of Contents Get a function name as a string using name Get a function name as a string using func_name Get a function name as a string using qualname Summary Get a function name as a string using …
How to Get the index column name in Pandas?
In this article, we will discuss multiple scenarios to get the index column name in pandas DataFrame. Table of Contents Preparing Dataset for solution Get Index Column name in DataFrame Get index name in MultiIndex DataFrame Summary Preparing Dataset for solution To quickly get started, let’s create a sample dataframe to experiment. We’ll use the …
Find Files by Name in Linux
In this article, we will discuss ways to find file by name recursively in Linux. Table of Contents Find file by name in a specified directory in Linux Find files by name in the current folder in Linux Summary Suppose you are using a Linux terminal and you need to search for a file you …