
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Rishikesh Kumar Rishi has Published 1156 Articles

Rishikesh Kumar Rishi
7K+ Views
To make a scatter plot for clustering in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x and y data points, Cluster and centers using numpy.Create a new figure or activate an existing figure.Add a subplot arrangement to ... Read More

Rishikesh Kumar Rishi
3K+ Views
To put a circle with annotation in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create data points using numpy.Get the point coordinate to put circle with annotation.Get the current axis.Plot the data and data points using plot() method.Set ... Read More

Rishikesh Kumar Rishi
2K+ Views
To get a 3D plot, we can use fig.add_subplot(111, projection='3d') method to instantiate the axis. After that, we can use the scatter method to draw different data points on the x, y, and z axes.StepsCreate a new figure, or activate an existing figure.Add an `~.axes.Axes` to the figure as part of ... Read More

Rishikesh Kumar Rishi
8K+ Views
We can use the shift() method in Pandas to shift the columns of a DataFrame without having to rewrite the whole DataFrame. shift() takes the following parametersshift(self, periods=1, freq=None, axis=0, fill_value=None)periods Number of periods to shift. It can take a negative number too.axis It takes a Boolean value; 0 if ... Read More

Rishikesh Kumar Rishi
7K+ Views
To find numeric columns in Pandas, we can make a list of integers and then include it into select_dtypes() method. Let's take an example and see how to apply this method.StepsCreate a two-dimensional, size-mutable, potentially heterogeneous tabular data, df.Print the input DataFrame, df.Make a list of data type, i.e., numerics, ... Read More

Rishikesh Kumar Rishi
18K+ Views
A regular expression (regex) is a sequence of characters that define a search pattern. To filter rows in Pandas by regex, we can use the str.match() method.StepsCreate a two-dimensional, size-mutable, potentially heterogeneous tabular data, df.Print the input DataFrame, df.Initialize a variable regex for the expression. Supply a string value as ... Read More

Rishikesh Kumar Rishi
4K+ Views
It's quite simple to rename a DataFrame column name in Pandas. All that you need to do is to use the rename() method and pass the column name that you want to change and the new column name. Let's take an example and see how it's done.StepsCreate a two-dimensional, size-mutable, ... Read More

Rishikesh Kumar Rishi
3K+ Views
To access a group of rows in a Pandas DataFrame, we can use the loc() method. For example, if we use df.loc[2:5], then it will select all the rows from 2 to 5.StepsCreate a two-dimensional, size-mutable, potentially heterogeneous tabular data, df.Print the input DataFrame, df.Use df.loc[2:5] to select the rows ... Read More

Rishikesh Kumar Rishi
1K+ Views
To delete the first three rows of a DataFrame in Pandas, we can use the iloc() method.StepsCreate a two-dimensional, size-mutable, potentially heterogeneous tabular data, df.Print the input DataFrame, df.Delete the first three rows using df.iloc[3:].Print the updated DataFrame.Example import pandas as pd df = pd.DataFrame( { ... Read More

Rishikesh Kumar Rishi
1K+ Views
To convert a Pandas DataFrame into a dictionary, we can use the to_dict() method. Let's take an example and see how it's done.StepsCreate two-dimensional, size-mutable, potentially heterogeneous tabular data, df.Print the input DataFrame, df.Convert the DataFrame into a dictionary using to_dict() method and print it.Example import pandas as pd ... Read More