Creating a matrix in Python

0 votes
How do I create a matrix in python? Are there 2D lists in python?
Jun 19, 2018 in Python by nightshade
• 870 points
52 views

1 answer to this question.

0 votes

You can create arrays of any number of dimensions using the numpy library:

import numpy as np 
a = np.array([[1,2,3],[4,5,6]]) 
answered Jun 19, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

Creating a new dict in Python

Call dict with no parameters new_dict = dict() or simply write new_dict ...READ MORE

answered Sep 17, 2018 in Python by Priyaj
• 56,960 points
43 views
+1 vote
1 answer

Creating a range of dates in Python

Yes, you can do it as follows: import ...READ MORE

answered Jul 4 in Python by Wajiha
• 1,930 points
39 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,810 points
243 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,420 points
136 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 405 views
+4 votes
6 answers
0 votes
1 answer

Call a shell command in Python?

Try this - os.system("commands and arguments") READ MORE

answered Jun 21, 2018 in Python by Hamartia's Mask
• 1,580 points
31 views
0 votes
1 answer

Remove duplicate elements in a list

Here is the code for this - list(set((list_of_numbers) For ...READ MORE

answered May 11, 2018 in Python by Hamartia's Mask
• 1,580 points
33 views