Quantcast
Viewing all articles
Browse latest Browse all 4448

Object dtype instead of float

@ASHISH_17 wrote:

Hello,

Below is the code :

table=dataset.pivot_table(index=[‘Gender’,‘Education’],values=‘LoanAmount’,aggfunc=np.median)
def fill(x):
if pd.isnull(x[‘LoanAmount’]):
return table.loc[x[‘Gender’],x[‘Education’]]
else:
return x[‘LoanAmount’]
train[‘LoanAmount’]=train.apply(lambda x:format(fill(x)),axis=1)
train[‘Loan_Amount_Term’]=train[‘Loan_Amount_Term’].fillna(360)

Dtype should be float64 but it is showing me object.
What am I missing ?(Avoid the indentation)

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles