Answers for "bad operand type for unary ~: 'float'"

0

bad operand type for unary ~: 'float'

df = pd.DataFrame({
    'column': ['Total','a',np.nan],
    'B': list(range(3))
})
print (df)
  column  B
0  Total  0
1      a  1
2    NaN  2

df = df[~df["column"].str.contains("Total", na=False)]
print (df)
  column  B
1      a  1
2    NaN  2
Posted by: Guest on February-21-2022

Code answers related to "bad operand type for unary ~: 'float'"

Python Answers by Framework

Browse Popular Code Answers by Language