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

Assignment 5

The document outlines a series of tasks to be completed using the Pandas library in Python. These tasks include creating and manipulating Series and DataFrames, performing arithmetic operations, converting data types, and analyzing data through statistical measures. The exercises cover a range of functionalities such as sorting, filtering, and modifying string values within Series.
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)
4 views2 pages

Assignment 5

The document outlines a series of tasks to be completed using the Pandas library in Python. These tasks include creating and manipulating Series and DataFrames, performing arithmetic operations, converting data types, and analyzing data through statistical measures. The exercises cover a range of functionalities such as sorting, filtering, and modifying string values within Series.
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/ 2

1.

Write a Pandas program to create and display a one-dimensional array-like Object containing an
array of data.

2. Write a Pandas program to convert a Panda module Series to Python list andit's type.Create a series
with random function and apply the above mentioned application.

3. Write a Pandas program to add, subtract, multiple and divide two Pandas Series. Series [2, 4, 6, 8,
10], [1, 3, 5, 7, 9]

4. Write a Pandas program to convert a dictionary to a Pandas series.

dictionary: d1 = {'a': 100, 'b': 200, 'c':300, 'd':400, 'e':800}

5. Write a Pandas program to convert a NumPy array to a Pandas series. NumPy array: d1 = [10, 20, 30,
40, 50].

6. Write a Pandas program to convert the first column of a Data Frame as a Series. The items are:--
{'col1': [1, 2, 3, 4, 7, 11], 'col2': [4, 5, 6, 9, 5, 0], 'col3': [7, 5, 8, 12, 1,11]}

7. Write a Pandas program to convert a given Series to an array. List is ['100', '200', 'python', '300.12',
'400']

8. Write a Pandas program to sort a given Series. ['100', '200', 'python', '300.12', '400'

9. Write a Pandas program to select rows from a given Data Frame based on values in some columns.
Data Frame col1 col2 col3

0147

1458

2369

3470

4581

Rows for colum1 value == 4 col1 col2 col3

1458

3470

10. Write a Pandas program to remove white spaces, left sided whites paces and right sided white spaces
of the string values of a given pandas series.

11. Write a Pandas program to create and display a Data Frame from aspecified dictionary data which
has the index labels. Data Frame:

exam_data = {'name': ['RISHABH KUMAR', 'SATYAM SINGH', 'SAURABH MISHRA',

'SHAURYA SHAKYA', 'SHIVAM', '],

'score': [12.5, 9, 16.5, np.nan, 9, 20, 14.5, np.nan, 8, 19],

'attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1],

'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']}

labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
12. Write a Pandas program to select the specified columns and rows from a given Data Frame .Select
'name' and 'score' columns in rows 1, 3, 5, 6from the following data frame. Data Frame:

exam_data = {'name': ['SHREYANSH', 'SAMRIDDHI', '', 'James', 'Emily',

'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas'],

'score': [12.5, 9, 16.5, np.nan, 9, 20, 14.5, np.nan, 8, 19],

'attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1],

'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']}

labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j

13. Write a Pandas program to create the mean and standard deviation of the data of a given Series.

14. Write a Pandas program to get the items of a given series not present in another given series..

15. Write a Pandas program to get the items which are not common of two given series.

16. Write a Pandas program to compute the minimum, 25th percentile, median, 75th, and maximum of a
given series.

17. Write a Pandas program to calculate the frequency counts of each unique value of a given series.

18. Write a Pandas program to display most frequent value in a given series and replace everything else
as 'Other' in the series.

19. Write a Pandas program to find the positions of numbers that are multiples of 5 of a given series.

20. Write a Pandas program convert the first and last character of each word to upper case in each word
of a given series.

21. Write a Pandas program to compute difference of differences between consecutive numbers of a given
series.

You might also like