python - Explanation needed: what does ~variable.MAKE.isnull() do? -


data = input_data[~input_data.make.isnull()] 

i new python , have been learning basics week. working on data science projects using basic skills. have above line in python tutorial i'm going through , i'm not sure does. can me it?

the tilde '~' "bitwise complement" operator; per the python wiki:

~ x

returns complement of x - number switching each 1 0 , each 0 1. same -x - 1.

input_data.make.isnull() give rows contain nulls in make, complement rows not, therefore:

data = input_data[~input_data.make.isnull()] 

will index input_data rows make isn't null, i.e. drop of rows is null.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -