Skip to content
Advertisement

How to change index and transposing in pandas

I’m new in pandas and trying to do some converting on the dateframe but I reach closed path.

my data-frame is:

JavaScript

I need this dataframe to be like the following:

JavaScript

as it shown I take the entity_name column as index without duplicates and the columns names from request_status column and the value from dcount

so please any one can help me to do that ?

many thanks

Advertisement

Answer

you can use pivot_table:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement