NaN Python yog dab tsi?
NaN Python yog dab tsi?

Video: NaN Python yog dab tsi?

Video: NaN Python yog dab tsi?
Video: Data Science with Python! Joining Tables Without a Common Column 2024, Kaum ib hlis
Anonim

nawj txhais tau hais tias "tsis yog tus lej", tus nqi ntab uas koj tau txais yog tias koj ua qhov kev suav uas nws tsis tuaj yeem qhia ua tus lej. Txhua qhov kev suav koj ua nrog NaN tseem yuav ua rau NaN . inf txhais tau tias infinity.

Tib neeg kuj nug, dab tsi ua rau NaN hauv Python?

Txoj cai tseem ceeb yog: Yog tias qhov kev siv ntawm ib txoj haujlwm ua txhaum ib qho ntawm cov kev txhaum saum toj no, koj tau txais a NaN . Piv txwv li, rau fft, koj yuav tsum tau txais NaN s yog tias koj qhov kev nkag siab qhov tseem ceeb nyob ib puag ncig 1e1010 lossis loj dua thiab ntsiag to poob ntawm qhov tseeb yog tias koj qhov kev nkag siab qhov tseem ceeb nyob ib puag ncig 1e-1010 lossis me dua.

NaN pandas yog dab tsi? Cov ntaub ntawv ploj tseem tuaj yeem xa mus rau NA (Tsis Muaj) qhov tseem ceeb hauv pandas . Tsis muaj: Tsis muaj ib qho khoom Python singleton uas feem ntau siv rau cov ntaub ntawv ploj lawm hauv Python code. NaN : NaN (ib qho acronym rau Tsis yog Tus Naj Npawb), yog qhov tshwj xeeb floating-point tus nqi lees paub los ntawm txhua lub tshuab uas siv tus qauv IEEE floating-point sawv cev.

Ib sab saum toj no, vim li cas NaN yog ntab Python?

NaN stands rau Tsis yog Tus lej thiab yog ib qho kev sawv cev ntawm cov ntaub ntawv uas ploj lawm. Nws yog ib qho tshwj xeeb ntab -point tus nqi thiab tsis tuaj yeem hloov mus rau lwm yam tshaj li ntab.

Tus nqi NaN yog dab tsi?

Hauv kev suav, NaN , sawv rau tsis muaj tus lej, yog ib tus tswv cuab ntawm cov ntaub ntawv tus lej uas tuaj yeem txhais tau tias yog a tus nqi uas yog undefined los yog unrepresentable, tshwj xeeb tshaj yog nyob rau hauv floating-point arithmetic. Nyob ntsiag to NAS yog siv los tshaj tawm qhov yuam kev uas tshwm sim los ntawm kev ua haujlwm tsis raug lossis tus nqi.

Pom zoo: