|
@@ 73-86 (lines=14) @@
|
| 70 |
|
in_dict['error details'] = err |
| 71 |
|
return in_dict |
| 72 |
|
|
| 73 |
|
@staticmethod |
| 74 |
|
def fn_internal_load_pickle_file_into_data_frame(in_dict): |
| 75 |
|
if in_dict['format'].lower() == 'pickle': |
| 76 |
|
try: |
| 77 |
|
out_data_frame = [] |
| 78 |
|
for index_file, crt_file in enumerate(in_dict['files list']): |
| 79 |
|
out_data_frame.append(index_file) |
| 80 |
|
out_data_frame[index_file] = pandas.read_pickle( |
| 81 |
|
filepath_or_buffer=crt_file, compression=in_dict['compression']) |
| 82 |
|
out_data_frame[index_file]['Source Data File Name'] = os.path.basename(crt_file) |
| 83 |
|
in_dict['out data frame'] = pandas.concat(out_data_frame) |
| 84 |
|
except Exception as err: |
| 85 |
|
in_dict['error details'] = err |
| 86 |
|
return in_dict |
| 87 |
|
|
|
@@ 44-57 (lines=14) @@
|
| 41 |
|
in_dict['error details'] = err |
| 42 |
|
return in_dict |
| 43 |
|
|
| 44 |
|
@staticmethod |
| 45 |
|
def fn_internal_load_json_file_into_data_frame(in_dict): |
| 46 |
|
if in_dict['format'].lower() == 'json': |
| 47 |
|
try: |
| 48 |
|
out_data_frame = [] |
| 49 |
|
for index_file, crt_file in enumerate(in_dict['files list']): |
| 50 |
|
out_data_frame.append(index_file) |
| 51 |
|
out_data_frame[index_file] = pandas.read_json( |
| 52 |
|
path_or_buf=crt_file, compression=in_dict['compression']) |
| 53 |
|
out_data_frame[index_file]['Source Data File Name'] = os.path.basename(crt_file) |
| 54 |
|
in_dict['out data frame'] = pandas.concat(out_data_frame) |
| 55 |
|
except Exception as err: |
| 56 |
|
in_dict['error details'] = err |
| 57 |
|
return in_dict |
| 58 |
|
|
| 59 |
|
@staticmethod |
| 60 |
|
def fn_internal_load_parquet_file_into_data_frame(in_dict): |