2

I have created an empty metrics in python say

metric = np.empty([1,6])

Now, I am inserting some values to its particular row and column as shown below

metric[0:1,1:2] = 1.23
metric[0:1,2:3] = 2.4
metric[0:1,3:4] = 20
metric[0:1,4:5] = 10
metric[0:1,5:6] = 0.56
metric[0:1,6:7] = 0.50

Now, apart from the integer value, I want to insert a string to the 6th column of 1st row. i.e.

metric[0:1,6:7] = str('5') + "Days"

which I want to insert "5 Days" in the 6th column of 1st row. How to do this?? please suggest...

1 Answer 1

1

This is because of dtype, default dtype for np array is float. you need to set it to object.

import numpy as np

metric = np.empty([1, 7], dtype=object)

metric[0,1] = 1.23
metric[0,2] = 2.4
metric[0,3] = 20
metric[0,4] = 10
metric[0,5] = 0.56
metric[0,6] = 'Days 0.50'

print(metric)
Sign up to request clarification or add additional context in comments.

5 Comments

Thankyou. Do you have any idea about One dimensional CNN??
I know what is 1d cnn, but can you explain what you are trying to do, so I can help you better.
I have a question regarding 1d CNN. the default structure of 1d CNN contains 1 fully connected dense layer after after flatten layer. So, if i add more dense layers before the output dense layer of 1d CNN, can i call it a hybrid of Conv1d and MLP?
I do not think it will be called hybrid of 1d cnn and MLP. It will be called cnn network only.
But nowhere I have seen more than 1 fully connected dense layer in CNN network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.