Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to map values using 3 columns?

$
0
0

@ASHISH_17 wrote:

Using pivot table, I am only able to find out Male who were married and irrespective of whether loan approved or not.
I want to find out Male who were married and were given Loan Status as 'Yes'.

Snippet in Python -

df.pivot_table(index=['Credit_History'],values='Loan_Status',aggfunc=lambda x:x.map({'Y':1,'N':0}).mean())

I want to find using this code but 3 columns instead of 2.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles