Post

[Python] Series 요소 개수 확인 :: Series.size

Series 요소 개수 확인 :: Series.size

Reference Pandas In Action
1
2
3
4
5
6
7
8
9
10
import pandas as pd

calories_info = {
    'Protein Bar' : 125,
    'Salade' : 215,
    'Chocolate Bar' : 406,
}

diet = pd.Series(calories_info)
diet
1
2
3
4
Protein Bar      125
Salade           215
Chocolate Bar    406
dtype: int64
1
diet.size # diet의 요소 개수
1
3
This post is licensed under CC BY 4.0 by the author.