Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Error Object arrays are not currently supported Python

Asked by Aashish Chaursiya Apr 23, 2021 1.2K views 1 answer
Share

About this question

import numpy as np
import math
time_decay_parameter = 0.055
h_column1_formula = np.repeat(1, 10)
h_column2_formula = []
h_column3_formula = []
for maturity in range(1,10):
h_column2_formula.append( (1-math.exp(- 
time_decay_parameter*maturity))/(time_decay_parameter*maturity))
h_column3_formula.append(((1-math.exp(- 
time_decay_parameter*maturity))/(time_decay_parameter*maturity))- 
math.exp(-time_decay_parameter*maturity))
h_column2_formula_array = np.asarray(h_column2_formula)
h_column3_formula_array = np.asarray(h_column3_formula)
h_matrix = np.array([h_column1_formula,h_column2_formula_array,h_column3_formula_array]).T
print(h_matrix)
ht_h = h_matrix.T@h_matrix
Getting error:
TypeError                                 Traceback (most recent call last)
in ()
     17 print('HMATRIX n')
     18 print(h_matrix)
---> 19 ht_h = h_matrix.T@h_matrix
TypeError: Object arrays are not currently supported

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.