I need to add a column and a row to an existing Numpy array at a defined position.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume your column and rows are just a list of lists?
That is, you have the following?
To add another row, use the append method of a list.
giving
To add another column, you would have to loop over each row. An easy way to do this is with a list comprehension.
giving