パンダの一般的なエラータイプTypeError:単項のオペランドタイプが正しくありません〜: 'float'



Pandas Common Error Type Typeerror



TypeError:単項のオペランドタイプが正しくありません〜:「float」
データにnull値またはNA値が含まれているため、パンダはこのエラーを報告しました。削除するだけ
コードは次のとおりです

import pandas as pd import numpy as np #Download Data data=pd.read_excel('./qs.xlsx') #How to determine if the data contains missing values-missing value detection #Recommended to use insnull + sum to determine missing values print(data.isnull().sum())#With value false, without value true print(data.notnull().sum()) #Delete method-dropna, delete in case of missing value-by row, by column #axisSpecify the axis to delete #howSpecify how to delete-- # any Delete any missing values #allDelete only if the entire column or row is missing #inplaceSpecify whether to affect the original #axisSpecify the axis to delete #howSpecify how to delete #any delete as long as there are missing values #allDelete as long as the entire column or row is missing values #inplaceSpecify whether to affect the original data.dropna(axis=0,how='any',inplace=False) data.dropna(axis=0,how='any',inplace=False)