1515
1616class NavData ():
1717 """gnss_lib_py specific class for handling data.
18- Uses numpy for speed combined with pandas like intuitive indexing
18+
19+ Uses numpy for speed combined with pandas like intuitive indexing.
20+
21+ Can either be initialized empty, with a csv file by setting
22+ ``csv_path``, a Pandas DataFrame by setting ``pandas_df`` or by a
23+ Numpy array by setting ``numpy_array``.
24+
25+ Parameters
26+ ----------
27+ csv_path : string
28+ Path to csv file containing data
29+ pandas_df : pd.DataFrame
30+ Data used to initialize NavData instance.
31+ numpy_array : np.ndarray
32+ Numpy array containing data used to initialize NavData
33+ instance.
34+ **kwargs : args
35+ Additional arguments (e.g. ``sep`` or ``header``) passed into
36+ ``pd.read_csv`` if csv_path is not None.
1937
2038 Attributes
2139 ----------
@@ -89,7 +107,8 @@ def from_pandas_df(self, pandas_df):
89107
90108 Parameters
91109 ----------
92- pandas_df : pd.DataFrame of data
110+ pandas_df : pd.DataFrame
111+ Data used to initialize NavData instance.
93112 """
94113
95114 if not isinstance (pandas_df , pd .DataFrame ):
@@ -112,7 +131,8 @@ def from_numpy_array(self, numpy_array):
112131 Parameters
113132 ----------
114133 numpy_array : np.ndarray
115- Numpy array containing data
134+ Numpy array containing data used to initialize NavData
135+ instance.
116136
117137 """
118138
@@ -128,7 +148,10 @@ def from_numpy_array(self, numpy_array):
128148 self [str (row_num )] = numpy_array [row_num ,:]
129149
130150 def concat (self , navdata = None , axis = 1 , inplace = False ):
131- """Concatenates new rows or new columns to existing NavData.
151+ """Concatenates second NavData instance by row or column.
152+
153+ Concatenates a second NavData instance to the existing NavData
154+ instance by either row or column.
132155
133156 Each type of data is included in a row, so adding new rows with
134157 ``axis=0``, means adding new types of data. Concat requires that
@@ -164,11 +187,11 @@ def concat(self, navdata=None, axis=1, inplace=False):
164187 """
165188
166189 if not isinstance (navdata ,NavData ):
167- raise TypeError ("new concat data must be a NavData instance." )
190+ raise TypeError ("concat input data must be a NavData instance." )
168191
169192 if axis == 0 : # concatenate new rows
170193 if len (self ) != len (navdata ):
171- raise RuntimeError ("new concat data must be same " \
194+ raise RuntimeError ("concat input data must be same " \
172195 + "length to concatenate new rows." )
173196 if not inplace :
174197 new_navdata = self .copy ()
0 commit comments