In pandas, dataframe and np.array The mutual transformation between the two

I’ve been looking online for a long time. Either the data frame is transformed into array or the array is transformed into data frame. So here’s a summary. The python generation of mutual transformation is as follows:

Transform dataframe into array
and

df=df.values

Transform array into dataframe

import pandas as pd

df = pd.DataFrame(df)

That’s OK!

Read More: