Skip to content

Commit

Permalink
#2285 Changed argument usecols to col_start and col_last for read_mpr
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Apr 13, 2023
1 parent 2feccc9 commit 993ec8c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions scripts/python/met/mprbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

class mpr_data():

def read_mpr(input_file, usecols=range(1,37), header=None,
delim_whitespace=True, keep_default_na=False,
skiprows=1, dtype=str):
mpr_data = pd.read_csv(input_file, header=header,
delim_whitespace=delim_whitespace,
keep_default_na=keep_default_na,
skiprows=skiprows, usecols=usecols,
dtype=dtype).values.tolist()
return mpr_data
# Read a text file with N columns and returns the list of N column data
# Skip first "col_start" columns if col_start is not 0.
def read_mpr(input_file, col_last, col_start = 0, header=None,
delim_whitespace=True, keep_default_na=False,
skiprows=1, dtype=str):
mpr_data = pd.read_csv(input_file, header=header,
delim_whitespace=delim_whitespace,
keep_default_na=keep_default_na,
skiprows=skiprows,
usecols=range(col_start,col_last+1),
dtype=dtype).values.tolist()
return mpr_data


########################################################################

0 comments on commit 993ec8c

Please sign in to comment.