Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 16, 2025
1 parent 834c8d9 commit c846698
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion vizro-ai/examples/goodreads_tutorial/filtered_books.csv
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ Maybe in Another Life,Taylor Jenkins Reid,"Reid, Taylor Jenkins",,139851666X,2,3
None of This Is True,Lisa Jewell,"Jewell, Lisa",,1804940224,1,4.12,400,2023,2023,07/09/2024
Africa Is Not A Country: Breaking Stereotypes of Modern Africa,Dipo Faloyin,"Faloyin, Dipo",,1473593433,4,4.43,340,2022,2022,09/09/2024
After the Funeral,Tessa Hadley,"Hadley, Tessa",,1473595290,4,3.82,226,2023,2023,21/09/2024
Strong Female Character,Fern Brady,"Brady, Fern",,1914240464,4,4.47,288,2023,2023,31/10/2024
Strong Female Character,Fern Brady,"Brady, Fern",,1914240464,4,4.47,288,2023,2023,31/10/2024
23 changes: 16 additions & 7 deletions vizro-ai/examples/goodreads_tutorial/goodreads.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"source": [
"# Vizro-AI setup\n",
"\n",
"from vizro import Vizro\n",
"import vizro_ai\n",
"from vizro_ai import VizroAI\n",
"from dotenv import load_dotenv\n",
"from vizro import Vizro\n",
"from vizro_ai import VizroAI\n",
"\n",
"# Ensure the API key is in .env\n",
"load_dotenv()\n",
Expand All @@ -23,13 +23,22 @@
"\n",
"import pandas as pd\n",
"\n",
"df = pd.read_csv('filtered_books.csv')\n",
"df[\"Date Read\"] = pd.to_datetime(df['Date Read'],dayfirst=True)\n",
"df = pd.read_csv(\"filtered_books.csv\")\n",
"df[\"Date Read\"] = pd.to_datetime(df[\"Date Read\"], dayfirst=True)\n",
"\n",
"# Data cleanup \n",
"# Data cleanup\n",
"# Specify columns to check for missing values\n",
"columns_to_check = ['Title', 'Author', 'ISBN', 'My Rating', 'Average Rating', 'Number of Pages', 'Original Publication Year', 'Date Read']\n",
"df_cleaned = df.dropna(subset=columns_to_check)\n"
"columns_to_check = [\n",
" \"Title\",\n",
" \"Author\",\n",
" \"ISBN\",\n",
" \"My Rating\",\n",
" \"Average Rating\",\n",
" \"Number of Pages\",\n",
" \"Original Publication Year\",\n",
" \"Date Read\",\n",
"]\n",
"df_cleaned = df.dropna(subset=columns_to_check)"
]
},
{
Expand Down

0 comments on commit c846698

Please sign in to comment.