ASSIGNMENTS Q.1 write statement to remove index for given dataframe as ...
[Pages:3]REINDEXING AND LABEL ALTERATION
ASSIGNMENTS
Q.1 write statement to remove index for given dataframe as df?
index NAME MARKS
first AMAN 93
second VISHAL 82
third MOHAK 44
fourth FREYA 93
fifth RAJESH 74
(Hint-reset_index())
Q.2 write statement to make month as index for given dataframe as
df?
month year sale
0 1
2012 55
1 4
2014 40
2 7
2013 84
3 10
2014 31
Now make month as index
(Hint- set_index())
Q.3 In dataframe of question no 2 ,find output as below(month as index but without heading)
year sale 1 2012 55 4 2014 40 7 2013 84 10 2014 31 (Hint- df.index.names)
Q.5 What is reindexing in pandas?
Q.6 What are the reindex function arguments?
Q.7 Does reindex require labels be unique,write relevant program for answer.
Q.8 write a program in python to display the data of following
dataframe in ascending order of marks and marks column should be
treated as index.
NAME
MARKS
0 AMAN
93
1 VISHAL 82
2 MOHAK 44
3 FREYA
93
4 RAJESH 74
OUTPUT should be like
NAME
MARKS
44
MOHAK
74
RAJESH
82
VISHAL
93
AMAN
93
FREYA
HINT-Use set_index(),sort_index() method
Q.9 Write a statement to change the column name from NAME to
STUDENT_NAME of following dataframe df
STUDENT NAME MARKS
0
AMAN
93
1
VISHAL
82
2
MOHAK
44
3
FREYA
93
4
RAJESH
74
Q.10 why indexing is used in pandas?
Q.11 why we should reindex the data of dataframe,even if these are
already indexed?
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- assignments q 1 write statement to remove index for given dataframe as
- cheat sheet pandas python datacamp
- pandas datareader documentation read the docs
- 3 how to remove column from dataframe using del statement
- 56 proc of the 9th python in science conf scipy 2010 data
- data wrangling tidy data pandas
- data handling using pandas 1
- pandasguide read the docs
- pandas dataframe notes university of idaho
- r dataframe remove na rows examples tutorial kart
Related searches
- how to write statement of purpose
- format pandas dataframe as percentage
- python remove index from df
- how to write statement letter
- pandas dataframe as list
- print pandas dataframe as table
- how to write statement of purpose masters
- remove index in pandas
- export python dataframe as csv
- append list to dataframe as row
- pandas remove index column
- remove index from array python