Advertisements
Advertisements
प्रश्न
Complete the given Python code to generate the following output:
COLOUR |
NAME |
QTY |
|
0 |
Red |
Apple |
10 |
1 |
Blue |
Berry |
15 |
2 |
Green |
Guava |
20 |
import ______ as pd
data=[{‘COLOUR’ : ‘Red’, ‘NAME’ : ‘Apple’, ‘QTY’ : 10},
{‘COLOUR’ : ‘Blue’, ‘NAME’ : ‘Berry’, ‘QTY’ : 15},
{______, 'NAME' : 'Guava', 'QTY' : 20}]
df=pd.DataFrame(______)
print(______)कोड लेखन
Advertisements
उत्तर
import pandas as pd
data=[{‘COLOUR’:‘Red’,‘NAME’:‘Apple’,‘QTY’:10},
{‘COLOUR’:‘Blue’,‘NAME’:‘Berry’,‘QTY’:15},
{‘COLOUR':'Green','NAME':'Guava','QTY':20}]
df = pd.DataFrame (0, 1, 2)
print (df)shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
