Suraj Joshi

Suraj Joshi

About Suraj Joshi

Suraj Joshi is a backend software engineer at Matrice.ai.

howto · 2026-09-14

Filter Pandas DataFrame Rows by Column Values

Filter pandas DataFrame rows with Boolean masks, loc, isin, between, string and missing-value tests, or query, including common errors.

howto · 2026-09-14

How to Save Plots as an Image File Without Displaying in Matplotlib

Save a Matplotlib figure without opening a window by using a non-interactive backend, savefig(), and the correct save-then-close order.

howto · 2026-09-14

Set Marker Size in a Matplotlib Scatter Plot

Set one marker size or a size for each point with Matplotlib scatter, scale marker areas correctly, and fix a mismatched size array.

howto · 2025-03-14

How to Save Files in Vim Before Quitting the Vim Editor

Learn how to save files in Vim before quitting the Vim editor with essential commands like :w, :q, and :wq. This guide provides a comprehensive overview of these commands, ensuring you can manage your files effectively and avoid losing your work. Mastering these commands will enhance your productivity and confidence while using Vim.

howto · 2025-03-14

How to Shutdown a Linux Machine Using Terminal

Learn how to shutdown a Linux machine using the terminal with our comprehensive guide. Explore various methods including immediate shutdown, scheduled shutdown, and rebooting options. Master these commands to manage your Linux system effectively and enhance your efficiency. Perfect for both beginners and experienced users.

howto · 2025-03-14

How to Use the sleep Command in Bash

Learn how to use the sleep command in Bash to pause execution of scripts effectively. This article covers basic usage, conditional statements, and tips for enhancing user experience in your Bash scripts. Discover practical examples and best practices to master the sleep command and improve your scripting skills.

howto · 2025-03-14

How to Install Sublime Text Editor on Ubuntu 18.04

Learn how to install Sublime Text Editor on Ubuntu 18.04 with this comprehensive guide. Follow simple steps to update your system, add the GPG key, and install Sublime Text using the apt command-line tool. Enhance your coding experience with one of the most popular text editors available.

howto · 2025-03-13

How to Perform Increment and Decrement Operation in Bash

Learn how to perform increment and decrement operations in Bash with our comprehensive guide. Discover various methods including arithmetic and unary operators, complete with clear examples. Enhance your Bash scripting skills and streamline your code with these essential techniques.

howto · 2025-03-13

How to Add Sudo Users in Ubuntu

Learn how to add sudo users in Ubuntu with this step-by-step guide. Discover two effective methods: adding users to the sudo group and modifying the /etc/sudoers file. This comprehensive article covers everything you need to know to manage user permissions securely and efficiently. Perfect for both beginners and experienced users, it provides clear instructions and examples.

howto · 2025-03-13

How to Add Super Users in CentOS

Learn how to add super users in CentOS by adding users to the wheel group or modifying the /etc/sudoers file. This comprehensive guide covers both methods with clear examples and explanations, ensuring you can manage user permissions effectively and securely.

howto · 2025-03-13

How to Read a File Line by Line Using Bash

Learn how to read a file line by line using Bash with our comprehensive guide. We explore various methods including the read command in loops and the mapfile command. Enhance your scripting skills and efficiently process text files with clear examples and detailed explanations. Perfect for beginners and experienced users alike, this article provides practical solutions for file handling in Bash.

howto · 2025-03-13

How to Change File Permissions in Linux

Learn how to change file permissions in Linux using the chmod command-line utility. This guide covers symbolic and numeric modes, providing clear examples to help you manage file access effectively. Enhance your Linux skills by mastering file permissions and ensuring security in your system.

howto · 2025-03-13

How to Install the pip Package Manager on Ubuntu

Learn how to install the pip package manager on Ubuntu using the apt command-line utility. This guide provides step-by-step instructions for both beginners and experienced developers. Discover how to manage Python packages efficiently with pip and enhance your Python development experience.

howto · 2025-03-13

How to Start, Stop and Restart Apache Web Server in Linux

Learn how to start, stop, and restart the Apache web server in Linux with our comprehensive guide. This article provides clear commands and explanations, making server management easy for both beginners and experienced users. Discover the importance of these operations for maintaining your web applications and ensuring a smooth user experience.

howto · 2025-03-13

How to Fill Between Multiple Lines in Matplotlib

Learn how to fill between multiple lines in Matplotlib with this comprehensive guide. Explore the use of the fill_between() function, see clear examples, and discover how to customize your plots for better data visualization. Enhance your skills in creating engaging and informative graphics with these techniques.

howto · 2025-03-13

How to Set X Axis Values in Matplotlib

This tutorial shows how to set X axis values using matplotlib.pyplot.xticks() in Matplotlib. Learn to customize tick frequency, rotate labels, and improve the clarity of your data visualizations. Discover techniques to enhance your plots and make them more informative.

howto · 2025-03-13

How to Plot NumPy Linear Fit in Matplotlib Python

This tutorial explains how to fit a curve to the given data using numpy.polyfit() method and display the curve using the Matplotlib package. Learn to visualize data effectively with step-by-step instructions and code examples. Discover how to create scatter plots and best-fit lines to uncover trends and insights in your data.

howto · 2025-03-13

How to Set Matplotlib Grid Interval

Learn how to set grid intervals in Matplotlib to enhance your data visualizations. This tutorial covers methods for customizing major and minor grids, providing code examples and detailed explanations. Improve your plots' readability and style with these essential techniques for effective data representation.

howto · 2025-03-13

How to Create Boxplot in Matplotlib

This tutorial explains how to create a boxplot using the matplotlib.pyplot.boxplot() function in Matplotlib. Learn to generate basic and customized boxplots, compare multiple datasets, and enhance your data visualization skills. Perfect for data analysts and scientists looking to interpret complex datasets effectively.

howto · 2025-03-13

How to Convert a NumPy Array to PIL Image in Python

This tutorial explains how to convert a NumPy array to a PIL image using the Image.fromarray() function from the PIL package. Learn step-by-step methods for handling both RGB and grayscale images, and discover how to customize image properties in Python. Enhance your image processing skills with practical examples and clear explanations.

howto · 2025-03-13

How to Set a Single Main Title for All the Subplots in Matplotlib

Learn how to set a single main title for all subplots in Matplotlib using pyplot.suptitle() and Figure.suptitle() methods. This guide provides clear examples and detailed explanations, enhancing your data visualization skills. Perfect for data analysts and Python enthusiasts looking to improve their plotting techniques.

howto · 2025-03-13

How to Create a Surface Plot in Matplotlib

Learn how to create stunning surface plots in Matplotlib using the plot_surface() method. This comprehensive guide covers setup, data preparation, and customization techniques to enhance your data visualization skills. Perfect for both beginners and experienced users, discover how to bring your data to life with beautiful 3D representations.

howto · 2025-03-11

How to Concatenate Strings in Bash

Discover how to concatenate strings in Bash easily with our comprehensive guide. Learn various methods, including basic concatenation, using the += operator, and incorporating command substitution. Master these techniques to enhance your Bash scripting skills and create dynamic outputs effortlessly. Perfect for beginners and experienced users alike, this article provides clear examples and explanations to help you navigate string manipulation in Bash.

howto · 2025-03-11

How to Remove a Git Remote URL

Learn how to remove a Git remote URL effectively with our step-by-step guide. This article covers the use of git remote rm and git remote remove commands, ensuring you can manage your Git repositories efficiently. Whether you're cleaning up or switching remotes, we provide clear examples and explanations to help you navigate your Git tasks with ease.

howto · 2025-03-11

How to Make New Directories in Linux

Learn how to create new directories in Linux using the mkdir command. This comprehensive guide covers basic directory creation, using Git, and advanced techniques for organizing your file structure. Master these skills to enhance your productivity and streamline your workflow in Linux.

howto · 2025-03-11

How to Add Comments in Bash Scripts

Learn how to add comments in Bash scripts effectively using the

howto · 2025-03-11

How to Perform Undo and Redo Operations in Vim and Vi

Learn how to perform undo and redo operations in Vim and Vi with our comprehensive guide. Discover essential commands like `u`, `Ctrl-R`, and advanced techniques to enhance your editing efficiency. Whether you are a beginner or an experienced user, mastering these features will streamline your workflow and improve your productivity in these powerful text editors.

howto · 2025-03-11

How to Install VMware Tools in Ubuntu 18.04

Learn how to install VMware Tools in Ubuntu 18.04 using Open VM Tools and the VMware Tools ISO file. This step-by-step guide provides clear instructions for optimizing your virtual machine's performance. Enhance graphics, enable shared folders, and improve mouse functionality effortlessly.

howto · 2025-03-11

How to Delete a User Account in Linux

Learn how to delete a user account in Linux using the userdel command line utility. This comprehensive guide covers different methods to remove accounts while retaining or deleting user data. Explore practical examples and best practices for effective user management in your Linux environment.

howto · 2025-03-11

How to Change User Password in Linux

Learn how to change user passwords in Linux using the passwd command-line utility. This comprehensive guide covers changing your own password, altering another user's password, and enforcing password policies for better security. Perfect for both beginners and experienced users, this article ensures you have the knowledge needed to manage user passwords effectively in a Linux environment.

howto · 2025-03-11

How to Save Figures Identical to the Displayed Figures in Matplotlib

This article demonstrates how to save figures in Matplotlib that are identical to those displayed on your screen. Learn effective methods using the savefig function, customize layouts, and choose the right formats to ensure high-quality visualizations for your projects. Mastering these techniques will enhance your data visualization skills and help you create professional-looking figures for presentations and publications.

howto · 2025-03-11

How to Make the Legend of the Scatter Plot in Matplotlib

Learn how to create and customize legends for scatter plots using Matplotlib in Python. This comprehensive guide provides step-by-step instructions and code examples to enhance your data visualizations. Discover the importance of legends, how to add them, and tips for customizing their appearance to improve clarity and engagement in your scatter plots.

howto · 2025-03-11

How to Display an Image With Matplotlib Python

Learn how to display images using Matplotlib in Python with this comprehensive guide. We cover essential methods such as loading images, customizing their display, and saving them for future use. Whether you are a beginner or an experienced programmer, this article will help you master image visualization techniques with Matplotlib.

howto · 2025-03-11

How to Hide Axis, Borders and White Spaces in Matplotlib

This tutorial explains how to hide the axis in Matplotlib plots using the axis('off') command and how to remove all white spaces and borders when saving figures. Learn to create cleaner visualizations that focus on your data without distractions. Perfect for enhancing presentations and reports.

howto · 2025-03-11

How to Add Text Inside the Plot in Matplotlib

This tutorial shows how to use the plt.text() method to add text to figures and axes in Matplotlib. Learn how to customize text appearance, create annotations with arrows, and include multi-line text to enhance your data visualizations. Discover practical examples and tips for making your plots informative and visually appealing.

howto · 2025-03-11

How to Use of pyplot.figure() in Matplotlib

This tutorial explains how to use matplotlib.pyplot.figure() to change various properties of a Matplotlib figure. Learn to customize figure size, resolution, background color, and create subplots for effective data visualization. Enhance your Matplotlib skills today!

howto · 2025-03-11

Pandas Plot Multiple Columns on Bar Chart With Matplotlib

Learn how to plot multiple columns on a bar chart using Pandas and Matplotlib in this comprehensive tutorial. Discover step-by-step methods to create, customize, and save your bar charts effectively. Perfect for data analysis and visualization enthusiasts looking to enhance their skills.

howto · 2025-03-11

How to Plot Points in Matplotlib

This tutorial explains how to plot data as points in Matplotlib using the matplotlib.pyplot.scatter() and matplotlib.pyplot.plot() methods. Learn the differences, customization options, and how to enhance your data visualizations effectively. Whether you're a beginner or looking to refine your skills, this guide offers practical examples and tips for creating stunning plots.

howto · 2025-03-11

Latex Formulas in Matplotlib

This tutorial explains how to render LaTeX formulas and equations in Matplotlib. Learn to create professional visualizations with LaTeX-enhanced titles, labels, and annotations. Discover methods to customize text rendering and enhance your plots with mathematical clarity. Perfect for scientists and engineers looking to elevate their work.

howto · 2025-03-11

How to Save Plots as PDF File in Matplotlib

Learn how to save plots as PDF files in Matplotlib using the savefig() function and PdfPages class. This guide covers saving single and multiple plots, along with customization options to enhance your visualizations. Perfect for reports and presentations!

howto · 2025-03-11

How to Change the Line Width of Lines in Matplotlib Legend

Learn how to change the line width of lines in the Matplotlib legend using set_linewidth() and setp() methods. This guide provides clear examples and explanations to enhance your data visualizations. Perfect for beginners and experienced users alike, discover effective techniques to improve the aesthetics and clarity of your plots.

howto · 2025-03-11

How to Add a Y-Axis Label to the Secondary Y-Axis in Matplotlib

Learn how to add a y-axis label to the secondary y-axis in Matplotlib using the axes object and pandas DataFrame plot method. This guide provides step-by-step instructions, code examples, and tips for customizing your visualizations. Perfect for data analysts and anyone interested in enhancing their data visualization skills.

howto · 2025-03-11

How to Write Multiline Strings in Go

Learn how to write multiline strings in Go using backquotes. This guide covers creating, formatting, and using multiline strings effectively, allowing you to maintain readability in your code. Discover practical examples, including SQL queries and special character handling, to enhance your Go programming skills.

howto · 2025-02-05

How to Remove Pandas DataFrame Index

This tutorial explains how to remove index of Pandas DataFrame.

api · 2024-02-16

Pandas DataFrame DataFrame.append() Function

The DataFrame.append method in Pandas merges rows of two different DataFrames and returns new DataFrame.

howto · 2024-02-16

How to Reverse Axes in Matplotlib

We can revert axes in Matplotlib using invert_xaxis() or invert_yaxis() methods for axes objects and axis() and xlim() or ylim() methods for pyplot objects.

howto · 2024-02-16

How to Set Limits for Axes in Matplotlib

We can set limits for axes in Matplotlib using xlim() or ylim(), set_xlim() or set_ylim() and axis() methods.

howto · 2024-02-16

How to Print Struct Variables in Console in Go

To print the structure in Go, we use fmt package which implements formatted I/O with functions.

howto · 2024-02-16

How to Find a Type of an Object in Go

We can inspect the datatype of variables in Go using the reflect package.

howto · 2024-02-15

How to Plot Time Series in Matplotlib

This article teaches you how to plot a time series in Matplotlib using the matplotlib.pyplot.plot_date() and matplotlib.pyplot.plot_date() methods.

howto · 2024-02-02

How to Concatenate Two Slices in Go

As slices are mutable in Go unlike the arrays, we can append new elements to a slice or append two or more slices using append() function.

howto · 2024-02-02

How to Make a Square Plot With Equal Axes in Matplotlib

We can use set_aspect() method and axis() method to make a square plot with equal axes in Matplotlib.

howto · 2024-02-02

How to Append Text to a File Using Bash

We can append text to a file using the Redirection (>>) operator, and the tee command.

howto · 2024-02-02

How to Extract Bzip2 Files Using Terminal

We can use the tar command to compress and extract files in .tar.bz2 and .tbz2 format.

howto · 2024-02-02

How to Install GCC Compiler on Ubuntu 18.04

We can install GCC compiler on Ubuntu using the apt command-line tool.

howto · 2024-02-02

How to Copy Files and Directories Using Linux Terminal

We can copy files and directories with cp, and rsync commands using Linux Terminal.

howto · 2024-02-02

How to Move Files and Directories in Linux Using Mv Command

We can move Files and Directories using mv command with various arguments through Linux Terminal.

howto · 2024-02-02

How to Check the Version of Ubuntu

We can check the version of Ubuntu installed in our system using the terminal, checking the etc files and through the Gnome.

howto · 2024-02-02

How to Enable Line Numbers in Vim/Vi

The line numbering feature is inactive by default in Vim and Vi editors but it can be easily turned on configuring the settings.

howto · 2024-02-02

How to Securely Transfer Files and Directories Using SCP

SCP is a command-line utility to transfer files and directories from local to a remote system and vice-versa. It also allows us to transfer files and directories between two remote systems.

howto · 2024-02-02

How to Compare Strings in Bash

We compare the strings using comparison operators and check whether the string contains substring or not using regular expressions.

howto · 2024-02-02

How to Use if...else Statement in Bash

We can use if...else statement in Bash to run the statements if particular condition is satisfied or not.

howto · 2024-02-02

How to View All the Installed Packages on Ubuntu

We can view all the installed packages on Ubuntu using apt and dpkg-query.

howto · 2024-02-02

How to Rename Files and Directories Using Linux Terminal

We can rename Files and Directories with rename and mv commands in the Linux Terminal.

howto · 2024-02-02

How to Use Functions in Bash

The same code that is to be used repeatedly is written as function definition and the portion where we need the code to be used, we simply call the function.

howto · 2024-02-02

How to Create a File Using the Terminal in Linux

We can create files with touch, echo, cat, dd and fallocate commands in Linux Terminal. Similarly, we can also create files from the terminal using the Redirection Operator and Heredoc.

howto · 2024-02-02

How to Use the gzip Command in Linux

We can use gzip command to compress and extract files in .gz or .z format.

howto · 2024-02-02

How to Use wget Command in Linux

We can use wget command in Linux to download files from the Internet using the HTTP, HTTPS, and FTP protocols with various options such as downloading multiple files at once, downloading in the background, limiting the bandwidth, and much more.

howto · 2024-02-02

How to Delete Files and Directories Using Python

We can delete files and directories in Python using functions from inbuilt packages like os, pathlib and shutil.

howto · 2024-02-02

How to Perform Copy, Cut and Paste Operations in Vim and Vi

This article introduces how to copy, cut and paste in Vim/Vi.

howto · 2024-02-02

How to Install RPM Pacakges on CentOS

We can install RPM packages on CentOS using yum and rpm command-line utilities.

howto · 2024-02-02

How to Delete Files and Directories in Linux Terminal

We can delete Files and Directories with rm, unlink, and rmdir commands using Linux Terminal

howto · 2024-02-02

How to Use while Loop in Bash

while loop is one of the most widely used loop structures in almost every programming language. We can specify a condition for the while loop and the statements in the loop are executed as long as the condition is true.

howto · 2024-02-02

How to Install Plex Media Server on Ubuntu

We can install the Plex Media Server from the Plex official repository.

howto · 2024-02-02

How to Specify the Legend Position in Graph Coordinates in Matplotlib

This article shows you how to specify the legend's position in a graph in Matplotlib.

howto · 2024-02-02

How to Plot a Table in Matplotlib

This article teaches you how to plot a table in Matplotlib using the matplotlib.pyplot.table() method.

howto · 2024-02-02

How to Display an Image in Grayscale in Matplotlib

This article introduces how to display a grayscale image in Matplotlib.

howto · 2024-02-02

How to Plot Histogram for List of Data in Matplotlib

This tutorial shows how we can use the plt.hist() method to plot histograms from a list of data. We can use the plt.hist() method to plot histograms from a list of data.

howto · 2024-02-02

How to Set Color for Scatterplot in Matplotlib

It demonstrates how you set color for scatter plot using the c parameter in matplotlib.pyplot.scatter() method.

howto · 2024-02-02

How to Draw an Arbitrary Line in Matplotlib

This tutorial explains how we can draw arbitrary lines in Matplotlib using the matplotlib.pyplot.plot(), matplotlib.pyplot.vlines(), matplotlib.pyplot.hlines() methods and matplotlib.collections.LineCollection.

howto · 2024-02-02

How to Add Subplot to a Figure in Matplotlib

This tutorial explains how we can add subplots to a Matplotlib figure using the Matplotlib.figure.Figure.add_subplot() method in Python.

howto · 2024-02-02

How to Create Density Plot in Matplotlib

To generate a density plot using Python, we at first estimate the density function from the given data using the gaussian_kde() method from the scipy.stats module and then plot the density function to generate the density plot.

howto · 2024-02-02

How to Set Number of Ticks in Matplotlib

This tutorial explains how we can set number of ticks in a Matplotlib figure using the Matplotlib.ticker.MaxNLocator class and set_ticks() method.

howto · 2024-02-02

How to Merge on Multiple Pandas Columns

This tutorial explains how we can merge two DataFrames in Pandas using the DataFrame.merge() method.

howto · 2024-02-02

How to Read Images using imread in Python Matplotlib

The article explains how we can read images from a file into an array using the imread() method from the Matplotlib package.

howto · 2024-02-02

How to Plot Smooth Curve in Matplotlib

This tutorial explains how we can plot a smooth curve from given coordinates using the modules from the scipy and matplotlib package.

howto · 2024-02-02

How to Plot Multiple Lines in Python Matplotlib

This tutorial explains how we can plot multiple lines in Python Matplotlib and set a different color for each line in the figure.

howto · 2024-02-02

How to Plot CDF Matplotlib Python

This tutorial explains how we can generate plot of CDF using the Matplotlib in Python.

howto · 2024-02-02

How to Label Scatter Points in Matplotlib

To label the scatter plot points in Matplotlib, we can use the matplotlib.pyplot.annotate() function which adds a string at the specified position. Similarly, we can also use the matplotlib.pyplot.text() function to add the text labels to points in the scatterplot.

howto · 2024-02-02

How to Create Reverse Colormap in Python Matplotlib

This tutorial explains the ways to reverse the colormap of a Python Matplotlib Plot.

howto · 2024-02-02

How to Create Colorplot of 2D Array Matplotlib

This tutorial explains how we can generate colorplot of 2D arrays using the matplotlib.pyplot.imshow() and matplotlib.pyplot.pcolormesh() methods in Python.

howto · 2024-02-02

How to Write a Pandas DataFrame to CSV

This tutorial explains how we can write a DataFrame into CSV file using the pandas.DataFrame.to_csv() function.

howto · 2024-02-02

How to Split Pandas DataFrame

This tutorial explains how we can split a DataFrame into multiple smaller DataFrames.

howto · 2024-02-02

How to Specify Suffix in Pandas join() Method

This tutorial explains how we can join two DataFrames in Pandas using the DataFrame.join() method.

howto · 2024-02-02

How to Select Pandas DataFrame Columns

This tutorial explains how we can select columns from a Pandas DataFrame by indexing or by using the DataFrame.drop() and DataFrame.filter() methods.

howto · 2024-02-02

How to Reset Pandas DataFrame Index

This tutorial explains how we can reset index in Python using pandas.DataFrame.reset_index()

howto · 2024-02-02

How to Pandas Create Column Based on Other Columns

In this tutorial we will introduce how we can create new columns in Pandas DataFrame based on the values of other columns in the DataFrame by applying a function to each element of a column or by using the DataFrame.apply() method.

howto · 2024-02-02

How to Load JSON File in Pandas

This tutorial explains how we can load a JSON file into Pandas DataFrame using the pandas.read_json() method.

howto · 2024-02-02

How to Groupby Two Columns in Pandas

This tutorial explains how we can use DataFrame.groupby() method in Pandas for two columns to separate the DataFrame into groups.

howto · 2024-02-02

How to Get the First Row of DataFrame Pandas

This tutorial explains how we can get the first row from a Pandas DataFrame using the pandas.DataFrame.iloc property, pandas.DataFrame.head() method, pandas.DataFrame.take(), based on specified condition, and using slicing.

howto · 2024-02-02

How to Get Dummies in Pandas

This tutorial explains how we can generate DataFrame with dummy or indicator variables from DataFrame with categorical columns.

howto · 2024-02-02

How to Get and Set Pandas DataFrame Index Name

This tutorial explains how we can set and get the name of index column of a Pandas DataFrame in Python.

howto · 2024-02-02

How to Filter Pandas DataFrame With Multiple Conditions

This tutorial explains how we can filter entries from a DataFrame based on multiple conditions.

howto · 2024-02-02

How to Exclude Pandas DataFrame Column

This tutorial explains how we can get all columns of a DataFrame except a particular column.

howto · 2024-02-02

How to Drop Rows With NaN in Pandas

This tutorial explains how we can drop all the rows with NaN values using DataFrame.notna() and DataFrame.dropna() methods.

howto · 2024-02-02

How to Drop Pandas Rows

This tutorial explains how we can drop rows in Pandas using the pandas.DataFrame.drop() method.

howto · 2024-02-02

How to Drop Duplicate Pandas Rows

This tutorial explains how we can remove all the duplicate rows from a Pandas DataFrame using the DataFrame.drop_duplicates() method.

howto · 2024-02-02

How to Count Unique Values in Pandas

This tutorial explains how we can count the unique values in a DataFrame using Series.value_counts() and DataFrame.nunique() methods.

howto · 2024-02-02

How to Copy Pandas DataFrame

This tutorial will introduce how we can make copy of a DataFrame object using DataFrame.copy() method and we will explore use of the DataFrame.copy() method.

howto · 2024-02-02

How to Convert NumPy Array to Pandas DataFrame

This tutorial explains how we can generate Pandas DataFrames from NumPy Arrays using the pandas.DataFrame() method.

howto · 2024-02-02

How to Convert Column Values to String in Pandas

This tutorial explains how we can convert the DataFrame column values to the string.

howto · 2024-02-02

How to Compare Pandas DataFrame Object

This tutorial explains how we can compare Pandas DataFrame objects in Python. Comparing DataFrames is very helpful to check differences between DataFrames.

howto · 2024-02-02

How to Replace NA Values using Pandas fillna()

This tutorial explains how we can fill NaN values with specified values using the DataFrame.fillna() method.

howto · 2024-02-02

How to Convert String to Numeric Type in Pandas

This tutorial explains how we can convert string values of Pandas DataFrame to numeric type using the pandas.to_numeric() method.

howto · 2024-02-02

How to Get First Row of Given Column Dataframe Pandas

This tutorial explains how we can get the first row of a given column in Pandas DataFrame using the Series.loc() and Series.iloc() method.

howto · 2024-02-02

How to Get Index of All Rows Whose Particular Column Satisfies Given Condition in Pandas

We can get indices of all rows whose particular column satisfies given condition in Pandas using simple indexing operation, np.where() function, and query() method.

howto · 2024-02-02

How to Iterate Through Rows of a DataFrame in Pandas

We can iterate over rows in Pandas using index attribute, loc() , iloc() , iterrows(), itertuples() , iteritems() and apply() methods.

howto · 2024-02-02

How to Create DataFrame Column Based on Given Condition in Pandas

We can create DataFrame column based on given condition in Pandas using list comprehension techniques,numpy methods, apply() method, and map() method for DataFrame objects.

howto · 2024-02-02

How to Create an Empty Column in Pandas DataFrame

We can add an empty column to DataFrame in Pandas using simple assignment operator, reindex(), assign() and insert() methods.

howto · 2024-02-02

How to Turn Off the Axes for Subplots in Matplotlib

We can turn off the axes for subplots in Matplotlib using set_axis_off(), axis() and set_visible() methods.

howto · 2024-02-02

How to Calculate Modular Multiplicative Inverse in Python

This article explores how to calculate the modular multiplicative inverse in Python using the Naive Iterative Approach, Modular Exponentiation, the Extended Euclidean Algorithm, and Fermat's Little Theorem.

howto · 2024-02-02

How to Add a New Column to Existing DataFrame With Default Value in Pandas

We can add a new column to existing DataFrame with default value in Pandas using assign or insert methods and by setting the value of the new column series.

howto · 2024-02-02

How to Randomly Shuffle DataFrame Rows in Pandas

We can randomly shuffle DataFrame rows in Pandas using sample(), shuffle(), and permutation() methods.

howto · 2024-02-02

How to Remove the Legend in Matplotlib

We could use get_legend().remove() and set_visible() methods to remove legend from a figure in Matplotlib. We can also remove legend from a figure in Matplotlib by setting legend to _nolegend_ in plot() method, axes.legend to None and figure.legends to empty list.

howto · 2024-02-02

How to Filter DataFrame Rows Based on the Date in Pandas

We can filter DataFrame rows based on the date in Pandas using the boolean mask, query method, isin method, and between method.

howto · 2024-02-02

How to Change Matplotlib Plot Size

We use figure(), set_figheight() along with set_figwidth()and set_size_inches() methods and set rcParams to change plot size in Matplotlib. To change the format of figure, we can just change extension in savefig() method.

howto · 2024-02-02

How to Extract Month and Year Separately From Datetime Column in Pandas

We can extract year and moth from the Datetime column using dt.year() and dt.month() methods respectively. We can also extract year and month using pandas.DatetimeIndex.month along with pandas.DatetimeIndex.year and strftime() method.

howto · 2024-02-02

How to Check if NaN Exisits in Pandas DataFrame

We can check if NaN exists in Pandas DataFrame by using isnull() and isna() methods.

howto · 2024-02-02

How to Plot Data in Real Time Using Matplotlib

We can plot data in real using Matplotlib through FuncAnimation() function, canvas.draw() along with canvas_flush_events() and using plt.plot() in a loop.

howto · 2024-02-02

How to Automate Plot Updates in Matplotlib

We can automatically update plots in Matplotlib using various functions such as plot.draw(), canvas.draw() along with canvas_flush_events(), and clear_output().

howto · 2024-02-02

How to Plot and Save a Graph in High Resolution in Matplotlib

We can control the resolution of the graph using various arguments of savefig() function while saving and figure() function while plotting in Matplotlib.

howto · 2024-02-02

How to Plot Logarithmic Axes in Matplotlib

We can plot logarithmic axes in Matplotlibusing set_yscale(), semilogy() and loglog() functions.

howto · 2024-02-02

How to Set the Figure Title and Axes Labels Font Size in Matplotlib

The size and font of title and axes in Matplotlib can be set using font size parameter, label.set_size(), and rcParams dictionary.

howto · 2024-02-02

How to Plot a Circle in Matplotlib

We can plot a circle using patches circle, circle equation, and scatter plot in Matplotlib.

howto · 2024-02-02

How to Plot a 2D Heatmap With Matplotlib

We can plot a 2D heatmap using imshow() function,seaborn library and pcolormesh() function.

howto · 2024-02-02

How to Display Multiple Images in One Figure Correctly in Matplotlib

We can display multiple images in one figure in Matplotlib by using subplot in for loop to display every image.

howto · 2024-02-02

How to Manually Set the Size of the Bins in Matplotlib Histogram

To manually set the size of the bins in Matplotlib we calculate the number of bins for required width and pass no. of bins as a parameter in hist2d() function.

howto · 2024-02-02

How to Change Space Between Subplots in Matplotlib

We use tight_layout(), subplots_adjust() and subplot_tool() methods to change subplot size/space in Matplotlib.

howto · 2024-02-02

How to Connect Scatterplot Points With Line in Matplotlib

We can connect scatterplot points with a line by calling show() after we have called both scatter() and plot(), calling plot() with the line and point attributes, and using the keyword zorder.

howto · 2024-02-02

How to Add Title to Subplots in Matplotlib

We can add a title to subplots in matplotlib using set_title() and title.set_text() method.

howto · 2024-02-02

How to Iterate Over an Entire Map in Go

We can iterate over an entire map by using for...range statement.

howto · 2024-02-02

How to Efficiently Concatenate Strings in Go

There are various ways of string concatenation in Go. Using built-in function copy is one of the most efficient to concatenate strings in Go

howto · 2024-02-02

How to Check if a Map Contains a Key in Go

We get two return values when we try to get the value of key in a Map. If the second value is true, then key is present on the map.

howto · 2024-02-02

How to Delete an Element From a Slice in Golang

Deleting an element from a slice is quite different from other languages. Elements need to be deleted from a slice by slicing them out.

howto · 2024-02-02

How to Parse Date String in Go

Go uses layout to parse a date string. Parsing is done with the help of Parse and Format functions in the time package.

howto · 2024-02-02

How to Convert an Int Value to String in Go

To convert int values to a string value, we use Itoa function from strconv package.

howto · 2024-02-02

How to Convert Go Struct to JSON

We can convert struct data into JSON using marshaling.

howto · 2024-02-02

How to Convert String to Integer Type in Go

To convert int values to a string value, we use Atoi function from strconv package.

howto · 2024-02-02

How to Remove Commas From String in Python

To remove comma from a string in Python, we can use the str.replace() method and the re package.

howto · 2024-02-02

How to Play Mp3 File Using Python

This tutorial explains how to play mp3 files with Python using packages like pygame, vlc, playsound and webbrowser.

api · 2023-01-30

Pandas DataFrame DataFrame.groupby() Function

The groupby() function in Pandas splits the given Datarame into groups based on some criteria.

api · 2023-01-30

Pandas DataFrame DataFrame.set_index() Function

The DataFrame.set_index method of Pandas is used to set columns or arrays as an index of DataFrame.

api · 2023-01-30

Pandas DataFrame DataFrame.sort_values() Function

The DataFrame sort_values() function sorts the given DataFrame in ascending or descending order.

api · 2023-01-30

Pandas DataFrame DataFrame.query() Function

The DataFrame.query method filters rows from the caller DataFrame that meet a certain condition.

api · 2023-01-30

Pandas DataFrame DataFrame.shift() Function

The DataFrame.shift(). function shifts the index of DataFrame by a specified number of periods.

api · 2023-01-30

Pandas DataFrame DataFrame.apply() Function

Pandas DataFrame apply() function applies the input function to every element along row or column of Pandas DataFrame.

api · 2023-01-30

Pandas Series Series.value_counts() Function

The Pandas Series.value_counts method counts the number of occurrences of each unique element in the Series.

api · 2023-01-30

Pandas DataFrame DataFrame.fillna() Function

The DataFrame fillna() function replaces all the NaN values in DatFrame with the specified method or value.

api · 2023-01-30

Pandas Series Series.unique() Function

The Pandas Series.unique method returns the unique values in the Python Pandas Series. The values are ordered by the appearance.

api · 2023-01-30

Pandas DataFrame DataFrame.mean() Function

The DataFrame mean() function calculates mean of values of DataFrame object over the specified axis.

api · 2023-01-30

Pandas DataFrame DataFrame.assign() Function

The DataFrame assign() function assigns new columns to the DataFrame.

api · 2023-01-30

Python numpy.argmax()

The numpy.argmax() function returns the indices of values with the highest values in the given NumPy array.

api · 2023-01-30

Python numpy.unique() Function

The numpy.unique() function retrieves all the unique values in the given NumPy array and sorts these unique values.

api · 2023-01-30

Python Numpy transpose() Function

The numpy.transpose() function reverses the axes of input array.

api · 2023-01-30

NumPy numpy.loadtxt() Function

The numpy.loadtxt() function loads data from text file.

api · 2023-01-30

NumPy numpy.dot Function

The numpy.dot() Function calculates the dot product of two input arrays

api · 2023-01-30

NumPy numpy.median Function

The numpy.median() Function calculates the median of values of a given numpy array over the specified axis.

api · 2023-01-30

NumPy numpy.random.rand() Function

The numpy.random.rand() function generates an array of specified shape with random values.

api · 2023-01-30

NumPy numpy.meshgrid Function

The numpy.meshgrid() Function creates a rectangular grid from given input arrays.

api · 2023-01-30

Pandas DataFrame DataFrame.merge() Function

The DataFrame merge() function merges DataFrame or named Series objects

api · 2023-01-30

Pandas DataFrame DataFrame.replace() Function

The replace() function in Pandas replaces values in DataFrame with other values.

api · 2023-01-30

Pandas DataFrame DataFrame.boxplot() Function

The DataFrame boxplot() function makes a box-and-whisker plot from DataFrame columns

api · 2023-01-30

Pandas read_csv() Function

Pandas read_csv() function reads the specified comma-separated values (csv) file into DataFrame.

api · 2023-01-30

Pandas DataFrame DataFrame.sum() Function

The DataFrame sum() function calculates the sum of values of DataFrame object over the specified axis.

api · 2023-01-30

Pandas DataFrame DataFrame.plot.scatter() Function

The DataFrame plot.scatter() function creates a scatter plot from DataFrame columns.

api · 2023-01-30

Pandas DataFrame DataFrame.interpolate() Function

The DataFrame interpolate() function fills NaN values in the DataFrame using the interpolation technique.

api · 2023-01-30

Pandas DataFrame DataFrame.drop_duplicates() Function

The DataFrame drop_duplicates() function removes all the duplicate rows from the DataFrame.

howto · 2023-01-30

Differences Between cla(), clf() and close() Methods in Matplotlib

This tutorial introduces the differences between methods: cla(), clf() and close(). matplotlib.pyplot.cla() method clears the current axes, matplotlib.pyplot.clf() method clears the current figure and matplotlib.pyplot.close() method closes the entire window.

howto · 2023-01-30

twinx and twiny in Matplotlib

This tutorial explains how we can create twin axes in Matplotlib with common X-axis or Y-axis using matplotlib.axes.Axes.twinx() and matplotlib.axes.Axes.twiny() in Python.

howto · 2023-01-30

Matplotlib.pyplot.specgram() in Python

This tutorial explains how we can plot spectrograms in Python using the matplotlib.pyplot.specgram() and scipy.signal.spectrogram() methods.

howto · 2023-01-30

Matplotlib 3D Projection

This tutorial explains how we can create 3d plots using the Matplotlib using the mplot3d package from the mpl_toolkits library.

howto · 2023-01-30

Pandas Insert Method

This tutorial explains how we can use insert method for a Pandas DataFrame to insert a column in the DataFrame.

howto · 2023-01-30

Pandas Groupby Count

This tutorial explains how we can get statistics like count, sum, max and much more for groups derived using DataFrame.groupby() method from a DataFrame.

howto · 2023-01-30

Pandas Correlation Matrix

In this tutorial, we will explain how we can generate a correlation matrix using the DataFrame.corr() method and visualize the correlation matrix using the pyplot.matshow() method from the Matplotlib module.

howto · 2023-01-30

Pandas loc vs iloc

This tutorial explains how we can filter data from a Pandas DataFrame using loc and iloc in Python.

howto · 2023-01-30

Difference Between Pandas apply, map and applymap

This tutorial explains the difference between apply(), map() and applymap() methods in Pandas.

api · 2023-01-30

Pandas DataFrame sort_index() Function

This tutorial explains how we can sort a Pandas DataFrame based on index using the pandas.DataFrame.sort_index() method.

api · 2023-01-30

Pandas cut Function

This tutorial explains how we can distribute data into ranges also called bins using the pandas.cut() method.

api · 2023-01-30

Pandas concat Function

This tutorial explains how we can concatenate Pandas DataFrame or Series objects using the pandas.concat() method.

api · 2023-01-30

SciPy scipy.interpolate.interp1d Function

The scipy.interpolate.interp1d() is used to calculate a function using the provided data points and can be calculated anytime, anywhere specified within the given domain using linear interpolation.

api · 2023-01-30

Scipy scipy.optimize.curve_fit Method

The scipy.optimize.curve_fit() function is used to find the best-fit parameters using a least-squares fit.

api · 2023-01-30

SciPy scipy.stats.linregress Method

This article demonstrates how to find a regression line for a given set of points using scipy.stats.linregress method of SciPy in Python.

api · 2021-12-15

SciPy scipy.stats.multivariate_normal

The scipy.stats.norm object is used to analyze the multivariate normal distribution and calculate different parameters related to the distribution using the different methods available.

howto · 2021-11-26

Pandas Map Python

This tutorial explains how we can replace values of a Pandas Series with another value using the Series.map() method.

howto · 2021-07-18

Linestyles in Matplotlib Python

This tutorial focuses on how we can use different linestyles in Matplotlib plot by setting the appropriate value of linestyle parameter in the matplotlib.pyplot.plt() method.

howto · 2021-01-25

Stack Bar Plots in Matplotlib

This tutorial shows how we can use the plt.bar() method to stack bar plot of a certain dataset over another. We generate bar plots in Matplotlib using the matplotlib.pyplot.bar() method.

howto · 2021-01-16

Pandas Axis Meaning

This tutorial explains the meaning of axis parameter used in various methods of Pandas objects like DataFrames and Series.