How to add numpy array values to dataframe at a certain index?

I have a dataframe df with 200 rows, and numpy array my_array with 15 values.

my_array = [41892.79355875, 40239.97933262, 39466.32169404, 38416.39545664,
            40012.3803004, 41135.45946026, 43084.18917943, 44825.08405799,
            44066.70603561, 46636.34415037, 45855.25783352, 45863.87118957,
            44697.45547342, 48065.5708295, 47931.83508874]

When I add the values of my_array into df under new column column_2, the 15 values get added into the first 15 rows of df.

df['column_2'] = pd.DataFrame(my_array, columns=['column_2'])

How do I make the code add the values of my_array into the last 15 rows of df?

Answer

For now another problem is that you also erase all others values of the column, you may not set a DataFrame but just the array as the new value.

To set values in a column, at specific index, use df.loc[df.index[#], 'NAME']

import numpy as np
import pandas as pd

df = pd.DataFrame([[1, 2] for _ in range(100)], columns=['column_1', 'column_2'])
my_array = np.array([41892.79355875, 40239.97933262, 39466.32169404, 38416.39545664,
                     40012.3803004, 41135.45946026, 43084.18917943, 44825.08405799,
                     44066.70603561, 46636.34415037, 45855.25783352, 45863.87118957,
                     44697.45547342, 48065.5708295, 47931.83508874])

df.loc[df.index[-15:], 'column_2'] = my_array

print(df)
    column_1      column_2
0          1      2.000000
1          1      2.000000
2          1      2.000000
3          1      2.000000
4          1      2.000000
..       ...           ...
95         1  45855.257834
96         1  45863.871190
97         1  44697.455473
98         1  48065.570830
99         1  47931.835089