For the given code fill in …
CBSE, JEE, NEET, CUET
Question Bank, Mock Tests, Exam Papers
NCERT Solutions, Sample Papers, Notes, Videos
For the given code fill in the blanks so that we get the desired output with sorting the
dataframe first on Quantity and second on Cost. 2
import pandas as pd
import numpy as np
d = {'Product':['Apple','Pear','Banana','Grapes'],'Quantity':[100,100,200,250],\
'Cost':[1000,1500,1200,900]}
df = pd.DataFrame(d)
df1 =
print(df1)
Product Quantity Cost
0 Apple 100 1000
1 Pear 100 1500
2 Banana 200 1200
3 Grapes 250 900
Posted by Anupam Kumar 3 years, 4 months ago
- 0 answers
ANSWER
Related Questions
Posted by Afsari Sultana 2 months, 2 weeks ago
- 0 answers
Posted by Sameer Ahmad 1 month, 2 weeks ago
- 1 answers
Posted by Samriti Sharma 2 months, 2 weeks ago
- 0 answers
Posted by Account Deleted 1 month ago
- 0 answers
Posted by Komalpreet Kaur 1 month, 2 weeks ago
- 1 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app