Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Cannot mask with non-boolean array containing NA / NaN values

# if there are null values (e.g. NaN) values in the column, then the following
# error will show:
# "Cannot mask with non-boolean array containing NA / NaN values"
# setting na=False for the contains() method solves the problem
df['column_name'].str.contains(string_to_be_matched_with, na=False)
Comment

ValueError: cannot mask with array containing NA / NaN values

mask = dframe.Product.str.contains(word, case=False, na=False)
Comment

PREVIOUS NEXT
Code Example
Python :: colab save figure 
Python :: sort tuple by first element python 
Python :: python print exception message and stack trace 
Python :: python urlencode 
Python :: python for file in dir 
Python :: gdscript string format 
Python :: meter to cm in python 
Python :: local image embed discord py 
Python :: sort by index 2d array python 
Python :: how to import pygame onto python 
Python :: Remove duplicates with pandas 
Python :: super idol 
Python :: pandas replace column name spaces with underscore 
Python :: get mouse click coordinates python turtle 
Python :: python delete saved image 
Python :: dotenv error pip python 
Python :: python reimport module after change 
Python :: django import Q 
Python :: get page source code selenium python 
Python :: flask cors 
Python :: horizontal bar chart with seaborn 
Python :: Presskeys in python 
Python :: how to add a image in tkinter 
Python :: copy image from one folder to another in python 
Python :: how to increase the figure size in matplotlib 
Python :: convert pdf to docx python 
Python :: get file name from url python 
Python :: convert pandas dataframe to spark dataframe 
Python :: python get how many days in current month 
Python :: numpy fill na with 0 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =