0% found this document useful (0 votes)
8 views3 pages

Pandas Assignment 1

Pandas example assignment

Uploaded by

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

Pandas Assignment 1

Pandas example assignment

Uploaded by

Amol
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Solve this assignment :

1) Write a Pandas program to convert a dictionary to a Pandas series


2) Sample Series:
3) Original dictionary:
4) {'a': 100, 'b': 200, 'c': 300, 'd': 400, 'e': 800}
5)
6) Converted series:
7) a 100
8) b 200
9) c 300
10) d 400
11) e 800
12) dtype: int64

2) Write a Pandas program to convert a NumPy array to a Pandas series.

Sample Series:
NumPy array:
[10 20 30 40 50]
Converted Pandas series:
0 10
1 20
2 30
3 40
4 50
dtype: int64

3) Write a Pandas program to change the data type of given a column or a Series.
Sample Series:
Original Data Series:
0 100
1 200
2 python
3 300.12
4 400
dtype: object
Change the said data type to numeric:
0 100.00
1 200.00
2 NaN
3 300.12
4 400.00
dtype: float64

4) Write a Pandas program to convert the first column of a DataFrame as a Series.


Original DataFrame
col1 col2 col3
0 1 4 7
1 2 5 5
2 3 6 8
3 4 9 12
4 7 5 1
5 11 0 11

1st column as a Series:


0 1
1 2
2 3
3 4
4 7
5 11
Name: col1, dtype: int64
<class 'pandas.core.series.Series'>
5) Write a Pandas program to sort a given Series.
Sample Output:
Original Data Series:
0 100
1 200
2 python
3 300.12
4 400
dtype: object
0 100
1 200
3 300.12
4 400
2 python
dtype: object

6) Upload and read the data from the .csv file and perform the following basic
operations on movies data

Datasetlink : download data of IMDB-Movie-Data.csv below link

https://drive.google.com/drive/folders/1bKHxzQTYs929WLfPYKdJnF6-
wyLwFuO2?usp=sharing

Perform basic following operations on this data

 Read data

 View the data

 Understand some basic information about the data

 Data Selection – Indexing and Slicing data

 Data Selection – Based on Conditional filtering (write any 10 filter conditions as you understanding data)

 Sorting operation

 Dealing with missing values

 Dropping columns

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy