- numpy - pandas - matplotlib

Online Python IDE

Use "shift" + "enter" to execute the commands.



Scroll down for matplotlib example. Copy and paste in the above editor to generate chart.
Explore solved python interview questions here .
Below table will help to understand that how to import libraries within the compiler :

Library Name Import Command Description
Matplotlib import matplotlib.pyplot as plt We are importing pyplot from matplotlib library as pyplot is the main function which will help in plotting the charts.
Pandas import pandas as pd We are importing full pandas library with alias name "pd".
Numpy import numpy as np We are importing full numpy library with alias name "np."



Example : Bar chart with Matplotlib

import matplotlib.pyplot as plt

grocery_data={"Bread":50, "Milk":70, "Veggies": 150, "Nuts": 500, "Fries":20}

item= list(grocery_data.keys())
amount= list(grocery_data.values())

fig, ax = plt.subplots()
plt.bar(item, amount, color="green", width=0.2)
plt.xlabel("Groceries")
plt.ylabel("Price")

#plt.show()
fig
                 

In the above code we have data in form of dictionary from which we are extracting information in two different lists and representing it with the chart to analyze the spendings.


Example : Pie chart with Matplotlib

We can use the below sample python program in the above compiler to generate matplotlib pie chart.


import matplotlib.pyplot as plt

x=[5,9,14]
y=['5','9','14']

fig, ax = plt.subplots()
plt.pie(x,labels=y)
#plt.show()
fig

	 
Check below FAQs to understand how to run or generate charts using matplotlib .
This is online python ide to practice python and run python programs online. This ide include libraries like pandas, numpy , matplotlib etc which can be used here to practice data analysis etc. In case you have any issue or want to ask or update us about anything then please contact us.


Don't Leave it to Chance


Create Your Professional Resume Now

FAQ

Online python compiler or interpreter is a tool or application with the help of which you can run or execute your python programs online and practice directly on the portal without the need of downloading and installing applicationfor this. This really help beginners to understand and try hands-on directly on the web.

You can directly start writing python program within the editor. Import necessary library required in your program and use run button or "shift+enter" to compile and run the program.
Below are the steps to use this compiler or IDE to run your python programs online:
STEP 1 : Write you python program within the editor. take care of the indentation as usual

STEP 2 : Use RUN button as shown below or use " shift + enter " to execute the command

STEP 3 : Result of the program will be shown just below the editor. it will also show you error if any.

You can write the matlpotlib program like below which will give you the results as shown below:



You can write the matlpotlib program like below which includes legend and colorful lines which will give you the results as shown below:

import matplotlib.pyplot as plt
from matplotlib import style

x=[5,9,14]
y=[6,8,15]

x1=[7,10,12]
y1=[9,11,18]

fig, ax = plt.subplots()
plt.plot(x,y, label="Principal")
plt.plot(x1,y1, label="Interest")
plt.legend()
fig

	 

Absolutely not. This python compiler is free to use and login is also not required if you only need to run python programs.

This online python compiler works on both mobile and laptop or PCs.

This editor includes basic python libraries along with libraries required for data analysis like pandas, numpy and matplotlib.