hole dataframe first line is missing
mhallipelto opened this issue · 2 comments
mhallipelto commented
ahartikainen commented
dict_list = self.survey.data
if not dict_list:
msg = "No data in Hole object. Header: {}".format(self.__str__())
logger.warning(msg)
return pd.DataFrame()
self._dataframe = pd.DataFrame(dict_list) # pylint: disable=attribute-defined-outside-init
self._dataframe.columns = ["data_{}".format(col) for col in self._dataframe.columns]
if not self._dataframe.empty:
self._dataframe.loc[0, self._dataframe.columns] = np.nan
for key in self.header.keys:
self._dataframe.loc[:, "Date"] = self.header.date
for key_, item in getattr(self.header, key).items():
self._dataframe.loc[:, "header_{}_{}".format(key, key_)] = item
for key in self.fileheader.keys:
for key_, item in getattr(self.fileheader, key).items():
self._dataframe.loc[:, "fileheader_{}_{}".format(key, key_)] = item
ahartikainen commented
self._dataframe.loc[0, self._dataframe.columns] = np.nan
why do we do this?