Pandas - find first non-null value in column

前端 未结 3 1430
清酒与你
清酒与你 2020-12-14 06:39

If I have a series that has either NULL or some non-null value. How can I find the 1st row where the value is not NULL so I can report back the datatype to the user. If th

3条回答
  •  孤城傲影
    2020-12-14 07:42

    You can also use get method instead

    (Pdb) type(audio_col)
    
    (Pdb) audio_col.first_valid_index()
    19
    (Pdb) audio_col.get(first_audio_idx)
    'first-not-nan-value.ogg'
    

提交回复
热议问题