Remove pandas reader code
@@ -478,55 +478,6 @@ def read_data_section_iterative_numpy_engine(file_obj, line_nos):
return array
-def read_data_section_iterative_pandas_engine(
- file_obj, line_nos, regexp_subs, value_null_subs, remove_startswith=None
-):
- """Read data section into memory.
-
- Arguments:
- file_obj: file-like object open for reading at the beginning of the section
- line_nos (tuple): the first and last line no of the section to read
- regexp_subs (list): each item should be a tuple of the pattern and
- substitution string for a call to re.sub() on each line of the
- data section. See defaults.py READ_SUBS and NULL_SUBS for examples.
- value_null_subs (list): list of numerical values to be replaced by
- numpy.nan values.
- remove_startswith (str): reject all lines starting with that value e.g. ``"#"``
-
-
- Returns:
- A 1-D numpy ndarray.
-
- """
- import pandas as pd
-
- logger.debug(f"regexp_subs: {regexp_subs}")
- na_str_values = [pattern for pattern, sub in regexp_subs]
- na_str_values = []
-
- title = file_obj.readline()
-
- nrows = (line_nos[1] - line_nos[0]) + 1
-
- logger.debug("Read data section using pd.read_csv")
- kws = {}
- if remove_startswith:
- kws["comment"] = remove_startswith
- array = pd.read_csv(
- file_obj,
- skiprows=0,
- header=None,
- nrows=nrows,
- delim_whitespace=True,
- na_values=na_str_values,
- **kws,
- ).values
-
- for value in value_null_subs:
- array[array == value] = np.nan
- return array
-
-
def get_substitutions(read_policy, null_policy):
"""Parse read and null policy definitions into a list of regexp and value
substitutions.
