How to manage Numpy arrays in Pandas DataFrames
How to manage Numpy arrays in Pandas DataFrames Let's assume one has a DataFrame with some integers values and some arrays defined somehow: df = pd.DataFrame(np.random.randint(0,100,size=(5, 1)), columns=['rand_int']) array_a = np.arange(5) array_b = np.arange(7) df['array_a'] = df['rand_int'].apply(lambda x: array_a[:x]) df['array_b'] = df['rand_int'].apply(lambda x: array_b[:x]) Some questions which can help me understand how to manage Numpy arrays with Pandas DataFrames: array_diff So you want to multiply both array a and array b by the corresponding value in rand_int? – user3483203 Jul 2 at 7:20 Not only that, but also define another column in df which is the np.setdiff1d between the rows in array_a and array_b . Thank you – espogian ...