Pandas Check If Column Is Object Type Code Example

Snippet 1

  for y in agg.columns:
    if(agg[y].dtype == np.float64 or agg[y].dtype == np.int64):
          treat_numeric(agg[y])
    else:
          treat_str(agg[y]) 

Copyright © Code Fetcher 2020

 

 

Leave a comment

Your email address will not be published. Required fields are marked *