Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to read multiple files in a loop in python

import numpy as np
files = ["a.txt", "b.txt"]
for file in files:
  print(np.loadtxt(file, skiprows=1))
Comment

PREVIOUS NEXT
Code Example
Python :: how to playsound in python 
Python :: python print user input 
Python :: count values pandas 
Python :: python program to find factorial 
Python :: python catch sigterm 
Python :: pyspark datetime add hours 
Python :: update print python 
Python :: data dictionary python into numpy 
Python :: sort list in python by substring 
Python :: static class python 
Python :: get all files in directory python 
Python :: beautifulsoup find_all by id 
Python :: tuple with one element python 
Python :: word pattern python 
Python :: python solve equation with two variables 
Python :: implicit conversion in python example 
Python :: sorting by second element 
Python :: im save to a bytes io python 
Python :: errno 13 permission denied python 
Python :: add whitespaces between char python 
Python :: numpy generate random 2d array 
Python :: python csv 
Python :: password text in entry in tkinter 
Python :: pandas reorder columns by name 
Python :: how to check nth prime in python 
Python :: python multiply list 
Python :: how to import flask restful using pip 
Python :: datetime utcnow 
Python :: python set comparison 
Python :: python3 send mail 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =