Question: I have a pandas data frame in the form of:

```
user_id referral_code referred_by
1        A              None
2        B              A
3        C              B
5        None           None
6        E              B
7        None           none

....

```

What I want to do is to create another column weight for each user id such that it will contain the total number of references he has done to others as well as the the number of time he was referred i.e I have to check if the referral\_code of a user id is present in the referred\_by column and count the frequency of the same and also add 1 if the referred\_by column has a entry for the user.

Expected output is:

```
user_id referral_code referred_by weights
1        A              None       1
2        B              A          3
3        C              B          1
5        None           None       None
6        E              B          1
7        None           none       none

```

The approaches if have tried is using `df.grouby` along with `size` and `count` but nothing is giving the expected output.

Answer: 
Contains works perfectly for me.

```
void main() {
  bool check;
  String email = 'tes t@test.com';

  check = email.contains(' ');

  print(check); // true
}

```

I have tried it on [DartPad](https://dartpad.dartlang.org/)

Perhaps you forgot to put whitespace between quotes.
The simplest solution to this is to call `trim()` on your email value before passing it. Something like this:

```
new AuthenticationService()
                  .signIn(_emailTextController.value.text.trim(),
                      _passwordTextController.value.text.trim())

```