Scenario: As the question title implies I am trying to convert a pandas dataframe to a numpy array. The dataframe has normal 2d data, just numbers. From other questions here in SO (such as Strange error during conversion from Panda Dataframe to numpy array Pandas series to numpy array conversion error Spyder Python "object arrays are currently not supported") and from the documentation I wrote the code. But apparently my problem is slightly different from those questions:
Problem: The code runs normally, and I can see the array in the variable explorer, but when I try to open it it yields:
Object arrays are currently not supported.
Question: What am I doing wrong? How can I fix it?
Obs: I am running python 2.7 on Spyder.
Code:
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
inp_file = df
compofile ="Co"
yieldfile = "Y"
maturityfile = "T"
countryfile ="Cou"
'#importing excel files
'co1 = pd.read_excel(inp_file,sheetname=cofile)
'y1 = pd.read_excel(inp_file,sheetname=yfile)
'm1 = pd.read_excel(inp_file,sheetname=mfile)
'cou1 = pd.read_excel(inp_file,sheetname=coufile)
co2 = inp_file.as_matrix()