I have two pd.DataFrame
objects (read from .csv file), say,
1, 2
1, 3
2, 4
and
2, 1
1, 2
3, 3
Suppose the DataFrame
's are named as data1
and data2
. So I can easily count the number of unique values in each column of data1
and data2
individually using
uniques = data.apply(pd.Series.nunique)
data
is replaced by data1
and data2
respectively. So I will get 2, 3
for data1
and 3, 3
for data2
. Is there a way (other than concatenating the DataFrame
's) so that I can get the number of unique values when these two DataFrame
's are combined? I want to get 3, 4
.