
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
16K+ Views
To extract csv file for specific columns to list in Python, we can use Pandas read_csv() method.StepsMake a list of columns that have to be extracted.Use read_csv() method to extract the csv file into data frame.Print the exracted data.Plot the data frame using plot() method.To display the figure, use show() method.Exampleimport pandas as ... Read More

Rishikesh Kumar Rishi
4K+ Views
To make a log histogram, we can use log=True in the argument of the hist() method.StepsMake a list of numbers.Plot a histogram with density=True.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True k = np.array([5, 5, 5, 5]) x, bins, ... Read More

Rishikesh Kumar Rishi
6K+ Views
To shade the regions between curves, we can use the fill_between() method.StepsInitialize the variable n. Initiliize x and y data points using numpy.Create a figure and a set of subplots, fig and ax.Plot the curve using plot method.Use fill_between() method, fill the area between the two curves.To display the figure, use show() method.Exampleimport numpy as np ... Read More

Rishikesh Kumar Rishi
5K+ Views
To plot with arrows in matplotlib, we can use arrow() method.StepsCreate x and y data points using numpy.Plot x and y with color=red and linewidth = 1.Use arrow method to add an arrow to the axes. The first two values in the arguments are the coordinates of the arrow base ... Read More

Rishikesh Kumar Rishi
1K+ Views
To center an annotation horizontally over a point, we can take the following steps−Create points for x and y using numpy.Create labels using xpoints.Use scatter() method to scatter the points.Iterate labels, xpoints and ypoints and annotate the plot with label, x and y with different properties, make horizontal alignment ha=center.To ... Read More

Rishikesh Kumar Rishi
4K+ Views
To share secondary Y-axis between subplots in matplotlib, we can take the following steps −Create x for data points.Add a subplot to the current figure, with nrows=2, ncols=1, at index=1 (ax0)Using twinx() method, create a twin of axes with a shared X-axis but independent Y-axis (ax1).Add a subplot to the current ... Read More

Rishikesh Kumar Rishi
1K+ Views
To read an image in Python cv2, we can take the following steps−Load an image from a file.Display the image in the specified window.Wait for a pressed key.Destroy all of the HighGUI windows.Exampleimport cv2 img = cv2.imread("baseball.png", cv2.IMREAD_COLOR) cv2.imshow("baseball", img) cv2.waitKey(0) cv2.destroyAllWindows()OutputRead More

Rishikesh Kumar Rishi
11K+ Views
To rotate xtick labels in Seaborn boxplot, we can take the following steps −Create data points for xticks.Draw a boxplot using boxplot() method that returns the axis.Now, set the xticks using set_xticks() method, pass xticks.Set xticklabels and pass a list of labels and rotate them by passing rotation=45, using set_xticklabels() method.To display ... Read More

Rishikesh Kumar Rishi
2K+ Views
To extract matplotlib colormap in hex-format, we can take the following steps −Get the rainbow color map.Iterate in the range of rainbow colormap length.Using rgb2hex method, convert rgba tuple to a hexadecimal representation of a color.Examplefrom matplotlib import cm import matplotlib cmap = cm.rainbow for i in range(cmap.N): rgba ... Read More

Rishikesh Kumar Rishi
2K+ Views
To directly overlay a scatter plot on top of a jpg image, we can take the following steps −Load an image "bird.jpg", using imread() method, Read an image from a file into an array.Now display data as an image.To plot scatter points on the image make lists for x_points and ... Read More