pandas 读取列数以及获取真实df长度(df.dropna)不好使情况下

读取时,不读取第一列


data = pd.read_csv('data.csv',index_col=0)

df_length = 0

for i in df['列名'].values:
    if i is not np.nan:
        df_length += 1

print(df_length)

 

 

posted @ 2021-08-27 09:32  CodeYaSuo  阅读(447)  评论(0编辑  收藏  举报