Skip to content

Commit

Permalink
Replace DataFrame append method with pandas.concat
Browse files Browse the repository at this point in the history
  • Loading branch information
mnishida committed Feb 28, 2022
1 parent 8a2e4b1 commit d3c04f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/riip/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _add_my_db_to_catalog(self, catalog: DataFrame) -> DataFrame:
list(self._extract_entry(self._my_db_path, start_id)),
columns=self._catalog_columns.keys(),
)
df = catalog.append(df, ignore_index=True)
df = pd.concat([catalog, df], ignore_index=True)
logger.info("Done.")
return df

Expand Down Expand Up @@ -422,7 +422,7 @@ def _create_raw_data_and_modify_catalog(
for idx in catalog.index:
logger.debug("{}: {}".format(idx, catalog.loc[idx, "path"]))
df_idx, catalog = self._extract_raw_data(idx, catalog)
df = df.append(df_idx, ignore_index=True)
df = pd.concat([df, df_idx], ignore_index=True)
df = df.astype(self._raw_data_columns)
catalog.to_csv(self._catalog_file, index=False, encoding="utf-8")
df.to_csv(self._raw_data_file, index=False, encoding="utf-8")
Expand Down Expand Up @@ -465,7 +465,7 @@ def _create_grid_data(self, catalog: DataFrame, raw_data: DataFrame) -> None:
ns = material.n(wls)
ks = material.k(wls)
data = {key: val for key, val in zip(columns, [idx, wls, ns, ks])}
df = df.append(DataFrame(data).loc[:, columns], ignore_index=True)
df = pd.concat([df, DataFrame(data).loc[:, columns]], ignore_index=True)
logger.setLevel(WARNING)
df = df.astype(self._grid_data_columns)
df.to_hdf(
Expand Down

0 comments on commit d3c04f1

Please sign in to comment.