You need to specify data, index and columns to DataFrame constructor, as in:

>>> pd.DataFrame(data=data[1:,1:], # values

… index=data[1:,0], # 1st column as index

… columns=data[0,1:]) # 1st row as the column names

edit: as in the @joris comment, you may need to change above to np.int_(data[1:,1:]) to have correct data type.

Here is an easy to understand solution

import numpy as np

import pandas as pd

# Creating a 2 dimensional numpy array

>>> data = np.array([[5.8, 2.8], [6.0, 2.2]])

>>> print(data)

>>> data

array([[5.8, 2.8],

[6. , 2.2]])

# Creating pandas dataframe from numpy array

>>> dataset = pd.DataFrame({‘Column1’: data[:, 0], ‘Column2’: data[:, 1]})

>>> print(dataset)

Column1 Column2

0 5.8 2.8

1 6.0 2.2