Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scanning 2d array in python

If you want to take n lines of input where each line contains m space separated integers like:

1 2 3
4 5 6 
7 8 9 

a=[] // declaration 
for i in range(0,n):   //where n is the no. of lines you want 
 a.append([int(j) for j in input().split()])  // for taking m space separated integers as input
Comment

PREVIOUS NEXT
Code Example
Python :: plt plot grid on 
Python :: python delete header row 
Python :: model.predict([x_test]) error 
Python :: python temporary files 
Python :: python: check type and ifno of a data frame 
Python :: python pandas replace nan with null 
Python :: skip rows in pandas read excel 
Python :: how to set icon in tkinter 
Python :: sqlalchemy if a value in list of values 
Python :: sqlalchemy datetime default now create table 
Python :: make a specific column a df index 
Python :: while loop countdown python 
Python :: python tkinter go to another window on button click 
Python :: show number as 3 digit python 
Python :: align columns to left pandas python 
Python :: python merge csv files in same folder 
Python :: how to iterate pandas dataframe 
Python :: download pdf using python 
Python :: csv write without new line 
Python :: all combination of params 
Python :: time counter in python 
Python :: python image to video 
Python :: python socket recv timeout 
Python :: how to find duplicate numbers in list in python 
Python :: first row as column df 
Python :: django queryset unique values 
Python :: check numpy arrays equal 
Python :: how to get a row from a dataframe in python 
Python :: python module with alphabet list 
Python :: python transform two columns to a list combine 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =