<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
I have data of sample 1 and sample 2 (`a` and `b`) – size is different for sample 1 and sample 2. I want to do a weighted (take n into account) two-tailed t-test.
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import scipy.stats
a = np.random.randn(40)
b = 4*np.random.randn(50)
_, p_value = scipy.stats.ttest_ind(a, b,  equal_var = False)
<END_TASK>