diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 7e4b0591..bfc573a2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,3 +7,4 @@ Shivam Soni Sriramya Bhamidipati Dalton Vega Daniel Neamati +Sandro Klarer diff --git a/gnss_lib_py/parsers/nmea.py b/gnss_lib_py/parsers/nmea.py index ae858a4e..9e1977e3 100644 --- a/gnss_lib_py/parsers/nmea.py +++ b/gnss_lib_py/parsers/nmea.py @@ -67,7 +67,7 @@ def __init__(self, input_path, msg_types=None, if msg_types is None: # Use default message types msg_types = ['GGA', 'RMC'] - pd_df = pd.DataFrame() + temporary_dictionary_list_df = [] field_dict = {} prev_timestamp = None @@ -101,8 +101,7 @@ def __init__(self, input_path, msg_types=None, delta_t = datetime.datetime.combine(datestamp(date), timestamp(time)) field_dict['gps_millis'] = datetime_to_gps_millis(delta_t) - new_row = pd.DataFrame([field_dict]) - pd_df = pd.concat([pd_df, new_row]) + temporary_dictionary_list_df.append(field_dict) field_dict = {} prev_timestamp = msg.timestamp if "sentence_type" in msg.__dir__() and msg.sentence_type in msg_types: @@ -134,8 +133,8 @@ def __init__(self, input_path, msg_types=None, date = field_dict.pop('datestamp') delta_t = datetime.datetime.combine(datestamp(date), timestamp(time)) field_dict['gps_millis'] = datetime_to_gps_millis(delta_t) - new_row = pd.DataFrame([field_dict]) - pd_df = pd.concat([pd_df, new_row]) + temporary_dictionary_list_df.append(field_dict) + pd_df = pd.DataFrame.from_dict(temporary_dictionary_list_df) # As per `gnss_lib_py` standards, convert the heading from degrees # to radians pd_df['true_course_rad'] = (np.pi/180.)*pd_df['true_course']\