Click here to Skip to main content
15,918,596 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hey all I am new to python.i need your help to create a data frame.

I need 5 columns(category,service,profile,os,price) in my data frame. The data is in nested form under every category(Com,DB) we have different services(ABC,XYZ) under every service there are different profile(SMALL, medium,VP,ram) ,for every profile we have os(some profile dont have os) and price.
Category      service     profile             os                    price
Com            ABC        SMALL            Windows8                   2
Com            ABC        SMALL            linux                     10
Com            ABC        medium           windows8                  10
Com            ABC        medium           linux                     20
DB             XYZ         VP                                         2
DB             XYZ         ram                                        4

     'SMALL': {
            'linux': 20

What I have tried:

i tried using for loop to get the data and after getting the data i converted that data in to dataframe.i am getting the data but not as mentioned in the description.
Updated 25-Sep-22 23:54pm
Richard MacCutchan 23-Sep-22 9:47am    
without seeing the actual code you use we cannot guess what is wrong. Please use the Improve question link above, and add complete details of what is not working.
Sarang Techie 26-Sep-22 5:07am    
Hi, this question looks like something ODD, cannot figure out if the code you entered is the right one or not. Please paste the exact code here or the error you are facing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900