I am trying to put my values into two arrays and then to make them a dataframe. I am using python, numpy and pandas to do so.
my arrays are:
k = [7.0, 8.0, 6.55, 7.0000001, 10.12]
p = [6.94, 9.0, 4.44444, 13.0, 9.0876]
and I would like to put them into a pandas dataframe. When I print my dataframe, I would like to see this:
a b c d e
k 7.0 8.0 6.6 7.0 10.1
p 6.9 9.0 4.4 13.0 9.1
How can I do that?
I read some related questions, but I can't get it right. One of the errors says that indexes must not be tuples, but, as you can see, I don't have tuples
pd.DataFrame(np.vstack((k,p)),index=['k','p'])?