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

Filling missing values

$
0
0

@ASHISH_17 wrote:

I am trying to fill missing values of Dependents column using the below code and getting -

TypeError: (‘cannot use label indexing with a null key’)

Code is -

table=df.pivot_table(index=‘Gender’,columns=‘Dependents’,values=‘ApplicantIncome’,aggfunc=‘mean’)
print table
def combine(x):
return table.loc[x[‘Gender’],x[‘Dependents’]]
df[‘Dependents’].fillna(df[df[‘Dependents’].isnull()].apply(fage1,axis=1),inplace=False)

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles