I am interested in knowing how to convert a pandas dataframe into a NumPy array.
dataframe:
import numpy as np import pandas as pd index = [1, 2, 3,
Two ways to convert the data-frame to its Numpy-array representation.
mah_np_array = df.as_matrix(columns=None)
mah_np_array = df.values
Doc: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.as_matrix.html