From e39a9a446a6ab120ed152aad7d2eef23c2be0032 Mon Sep 17 00:00:00 2001 From: Nathan Evans Date: Mon, 9 Dec 2024 18:34:14 -0800 Subject: [PATCH] Format --- docs/examples_notebooks/index_migration.ipynb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/examples_notebooks/index_migration.ipynb b/docs/examples_notebooks/index_migration.ipynb index 1393cf0c1c..e8942ff5b5 100644 --- a/docs/examples_notebooks/index_migration.ipynb +++ b/docs/examples_notebooks/index_migration.ipynb @@ -62,6 +62,7 @@ "outputs": [], "source": [ "def remove_columns(df, columns):\n", + " \"\"\"Remove columns from a DataFrame, suppressing errors.\"\"\"\n", " df.drop(labels=columns, axis=1, errors=\"ignore\", inplace=True)" ] }, @@ -108,12 +109,25 @@ "# We renamed \"name\" to \"title\" for consistency with the rest of the tables\n", "if \"name\" in final_entities.columns:\n", " final_entities.rename(columns={\"name\": \"title\"}, inplace=True)\n", - "remove_columns(final_entities, [\"mname_embedding\", \"graph_embedding\", \"description_embedding\"])\n", + "remove_columns(\n", + " final_entities, [\"mname_embedding\", \"graph_embedding\", \"description_embedding\"]\n", + ")\n", "\n", "# Final nodes uses community for joins, which is now an int everywhere\n", "final_nodes[\"community\"] = final_nodes[\"community\"].fillna(-1)\n", "final_nodes[\"community\"] = final_nodes[\"community\"].astype(int)\n", - "remove_columns(final_nodes, [\"type\", \"description\", \"source_id\", \"graph_embedding\", \"entity_type\", \"top_level_node_id\", \"size\"])\n", + "remove_columns(\n", + " final_nodes,\n", + " [\n", + " \"type\",\n", + " \"description\",\n", + " \"source_id\",\n", + " \"graph_embedding\",\n", + " \"entity_type\",\n", + " \"top_level_node_id\",\n", + " \"size\",\n", + " ],\n", + ")\n", "\n", "# Relationships renames \"rank\" to \"combined_degree\" to be clear what the default ranking is\n", "if \"rank\" in final_relationships.columns:\n",