- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 1162 Articles
Rishikesh Kumar Rishi
26K+ Views
Using Pandas, we can create a dataframe and can set the index for datetime. Using gcf().autofmt_xdate(), we will adjust the date on the X-axis.StepsMake the list of date_time and convert into it in date_time using pd.to_datetime().Consider data = [1, 2, 3]Instantiate DataFrame() object, i.e., DF.Set the DF['value'] with data from ... Read More
Rishikesh Kumar Rishi
25K+ Views
To find the maximum value of a column and to return its corresponding row values in Pandas, we can use df.loc[df[col].idxmax()]. Let's take an example to understand it better.StepsCreate a two-dimensional, size-mutable, potentially heterogeneous tabular data, df.Print the input DataFrame, df.Initialize a variable, col, to find the maximum value of ... Read More
Rishikesh Kumar Rishi
27K+ Views
Using subplot(row, col, index) method, we can split a figure in row*col parts, and can plot the figure at the index position. In the following program, we will create two diagrams in a single figure.StepsCreating x, y1, y2 points using numpy.With nrows = 1, ncols = 2, index = 1, ... Read More
Rishikesh Kumar Rishi
37K+ Views
To plot CSV data using Matplotlib and Pandas in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make a list of headers of the .CSV file.Read the CSV file with headers.Set the index and plot the dataframe.To display the ... Read More
Rishikesh Kumar Rishi
39K+ Views
To label a line in matplotlib, we can use label in the argument of plot() method, StepsSet the figure size and adjust the padding between and around the subplots.Plot with label="line1" using plot() method.Plot with label="line2" using plot() method.To place a legend on the figure, use legend() method.To display the ... Read More
Rishikesh Kumar Rishi
44K+ Views
To plot an array in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create two arrays, x and y, using numpy.Set the title of the curve using title() method.Plot x and y data points, with red color.To display the ... Read More
Rishikesh Kumar Rishi
52K+ Views
To plot a function defined with def in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a user-defined function using, def, i.e., f(x).Create x data points using numpy.Plot x and f(x) using plot() method.To display the figure, use ... Read More
Rishikesh Kumar Rishi
63K+ Views
First of all, make sure you have python and pip preinstalled on your system. To check Python version, typepython --versionTo check pip version, typepip −VThen, run the following pip command in the command prompt to install Matplotlib.pip install matplotlibTo verify that matplotlib is successfully installed on your system, execute the ... Read More
Rishikesh Kumar Rishi
59K+ Views
To plot a single data point in matplotlib, we can take the following steps −Initialize a list for x and y with a single value.Limit X and Y axis range for 0 to 5.Lay out a grid in the current line style.Plot x and y using plot() method with marker="o", ... Read More
Rishikesh Kumar Rishi
71K+ Views
To set X-axis values in matplotlib in Python, we can take the following steps −Create two lists for x and y data points.Get the xticks range value.Plot a line using plot() method with xtick range value and y data points.Replace xticks with X-axis value using xticks() method.To display the figure, use show() method.Examplefrom matplotlib import ... Read More