Help! I need to translate a one-dimensional array into a column in a pandas DataFrame. I do it like this:

out_put = pd.DataFrame(is_in,['Вхождение']) 

where is_in is a one-dimensional array. But I get a string at the output. What magic should I add to get a column?

    1 answer 1

    The pd.DataFrame() constructor expects a vector of indices as the second parameter. To specify the name (s) of the columns, specify the name of the columns parameter explicitly.

    Example:

     In [93]: df = pd.DataFrame([10,11,12,13], columns=['Вхождение']) In [94]: df Out[94]: Вхождение 0 10 1 11 2 12 3 13