def _generate_multi_thread_dataframe(parser, path, num_rows, num_tasks):
def reader(arg):<EOL><INDENT>"""<STR_LIT>"""<EOL>start, nrows = arg<EOL>if not start:<EOL><INDENT>return parser.read_csv(path, index_col=<NUM_LIT:0>, header=<NUM_LIT:0>,<EOL>nrows=nrows, parse_dates=["<STR_LIT:date>"])<EOL><DEDENT>return parser.read_csv(path, index_col=<NUM_LIT:0>, header=None,<EOL>skiprows=int(start) + <NUM_LIT:1>,<EOL>nrows=nrows, parse_dates=[<NUM_LIT:9>])<EOL><DEDENT>tasks = [<EOL>(num_rows * i // num_tasks,<EOL>num_rows // num_tasks) for i in range(num_tasks)<EOL>]<EOL>pool = ThreadPool(processes=num_tasks)<EOL>results = pool.map(reader, tasks)<EOL>header = results[<NUM_LIT:0>].columns<EOL>for r in results[<NUM_LIT:1>:]:<EOL><INDENT>r.columns = header<EOL><DEDENT>final_dataframe = pd.concat(results)<EOL>return final_dataframe<EOL>
Generate a DataFrame via multi-thread.

Parameters
----------
parser : BaseParser
    The parser object to use for reading the data.
path : str
    The location of the CSV file to read.
num_rows : int
    The number of rows to read per task.
num_tasks : int
    The number of tasks to use for reading this DataFrame.

Returns
-------
df : DataFrame