Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python find cells with na

In [152]: import numpy as np
In [153]: import pandas as pd
# to return the row and column indices where the value in NaN
In [154]: np.where(pd.isnull(df))
Out[154]: (array([2, 5, 6, 6, 7, 7]), array([7, 7, 6, 7, 6, 7]))

In [155]: df.iloc[2,7]
Out[155]: nan

In [160]: [df.iloc[i,j] for i,j in zip(*np.where(pd.isnull(df)))]
Out[160]: [nan, nan, nan, nan, nan, nan]
Comment

PREVIOUS NEXT
Code Example
Python :: fillna pandas inplace 
Python :: Binary search tree deleting 
Python :: how to loop through every character in a string 
Python :: python avg 
Python :: python read file between two strings 
Python :: python kubernetes client find pod with name 
Python :: format exponentials python 
Python :: python logging levels 
Python :: decision tree 
Python :: inline if statement python return 
Python :: how to check if a key is present in python dictionary 
Python :: pyqt5 app styles 
Python :: seaborn heatmap center xticks 
Python :: what is an object in python 
Python :: find difference between two pandas dataframes 
Python :: check if a string is palindrome or not using two pointer function in python 
Python :: Merge 2 or more notebooks into one 
Python :: how to add items to a set in python 
Python :: import combination 
Python :: number length python 
Python :: string in netcdf file python 
Python :: Acticating virtual environment 
Python :: newtorkx remove node 
Python :: ensemble model using voting classifier 
Python :: centos install python 3.9 thelinuxterminal.com 
Python :: how to sum numpy matrix diagonal 
Python :: Python NumPy asfarray Function Example Tuple to float type array 
Python :: python all list items to lower case 
Python :: websocket api python on close 
Python :: str remove except alphabets 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =