Question: I am using apache kafka in 1st server and apache zookeeper in 2nd server.
I want to have kafka connect service in other server.Is it possible to use a standalone service. I need to have apache kafka connect or confluent kafka connect

Answer: 
To filter the dataframe, we can count the not nan value along columns

```py
cols = ['pass', 'shoot', 'flick', 'through-ball']

filtered = df[df[cols].notna().sum(axis=1).eq(1)]

```

```
print(filtered)

   index    id  pass  shoot  flick  through-ball
0  22450   123   NaN    NaN    NaN         600.0
1  22451  6565   NaN    NaN    NaN         625.0
3  22453   101   NaN    NaN  119.0           NaN

```

We can loop the columns to get unique value count in each column

```py
out = pd.DataFrame([[col, filtered[col].nunique()] for col in cols],
                   columns=['actions', 'unique_count'])

```

```
print(out)

        actions  unique_count
0          pass             0
1         shoot             0
2         flick             1
3  through-ball             2

```
We can filter it

```
df = df[df.notna().sum(1)==3]
Out[262]: 
   index    id  pass  shoot  flick  through-ball
0  22450   123   NaN    NaN    NaN         600.0
1  22451  6565   NaN    NaN    NaN         625.0
3  22453   101   NaN    NaN  119.0           NaN

```

Then `count`

```
df.drop(['index', 'id'],axis=1).count().iloc[2:]
Out[267]: 
pass            0
shoot           0
flick           1
through-ball    2
dtype: int64

```