IN PANDAS
SIZE-
DataFrame.size
This function will return the size of DataFrame.
Example -
>>> s = pd.name({'s': 1, 'h': 2, 'i': 3, ‘v’:4}
>>> s.size
4
COUNT-
DataFrame.count
This function counts all the non- NA values of the DataFrame.
NA values are - None, NaN, NaT.
EXAMPLE -
Constructing DataFrame from a dictionary:
>>> df = pd.DataFrame({"Name":
... ["shivangi", "sakshi", "aditi", "aditya", "vanshika"],
... "Sex": [F, np.nan, F, M, F],
... "Age": [21, 28, np.nan, 30, 46)
>>> df
Name Sex Age
0 shivangi F 21
1 sakshi NaN 28
2 aditi F NaN
3 aditya M 30
4 vanshika F 46
The NA values will not be counted :
>>> df.count()
Name 5
Sex 4
Age 4
So, basically size will count all values including Nan, whereas count will count all values excluding Nan.