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
• 880 points
866 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
• 58,020 points
566 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, 2019 in Python by Wajiha
• 1,960 points
1,453 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,890 points
20,017 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,440 points
1,308 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,443 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,078 views
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
765 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 12, 2018 in Python by Hamartia's Mask
• 1,580 points
882 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP