0% found this document useful (0 votes)
5 views2 pages

Python Program Using Pandas For

The document contains a Python program that utilizes Pandas to organize data about countries, including their capitals, area, and population into a table. Additionally, it includes a program using Matplotlib to create a linear plot of data. The code demonstrates basic data manipulation and visualization techniques in Python.

Uploaded by

amanpreet.e15674
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Python Program Using Pandas For

The document contains a Python program that utilizes Pandas to organize data about countries, including their capitals, area, and population into a table. Additionally, it includes a program using Matplotlib to create a linear plot of data. The code demonstrates basic data manipulation and visualization techniques in Python.

Uploaded by

amanpreet.e15674
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

# Python program using Pandas for

# arranging a given set of data


# into a table

# importing pandas as pd
import pandas as pd

data = {"country": ["Brazil", "Russia", "India", "China", "South


Africa"],
"capital": ["Brasilia", "Moscow", "New Delhi", "Beijing", "Pre-
toria"],
"area": [8.516, 17.10, 3.286, 9.597, 1.221],
"population": [200.4, 143.5, 1252, 1357, 52.98] }

data table = [Link](data)


print(data_table)
# Python program using Matplotlib
# for forming a linear plot

# importing the necessary packages and modules


import [Link] as plt
import numpy as np

# Prepare the data


x = [Link](0, 10, 100)

# Plot the data


[Link](x, x, label ='linear')

# Add a legend
[Link]()

# Show the plot


[Link]()

You might also like