"# Read the file, allowing malformed rows to be skipped\n",
"# Read the file, allowing malformed rows to be skipped\n",
...
@@ -34,11 +45,156 @@
...
@@ -34,11 +45,156 @@
"\n",
"\n",
" print(\"Data loaded and cleaned successfully.\")\n",
" print(\"Data loaded and cleaned successfully.\")\n",
"except Exception as e:\n",
"except Exception as e:\n",
" print(\"Error during cleaning:\", str(e))\n",
" print(\"Error during cleaning:\", str(e))"
"\n",
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data loaded and cleaned successfully.\n"
]
}
],
"execution_count": 7
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-13T15:39:33.364366Z",
"start_time": "2025-01-13T15:39:33.344373Z"
}
},
"cell_type": "code",
"source": [
"# Check the first few rows of the data\n",
"# Check the first few rows of the data\n",
"data.head()\n",
"data.head()"
"\n",
],
"outputs": [
{
"data": {
"text/plain": [
" id \\\n",
"1 |When Lou who has become the \"father of the Internet is shot by an unknown assailant, Jacob and Nick... director Christopher Guest reunites the team fr... who inspired by the death of their former man... \n",
"17 |After attending the funeral of her grandmother... the Lux Atlantic Hotel manager Lisa is waiting ... she meets in the airport bar Jack Rippner who is also in the waiting list. They sit toget... and Jack reveals that he wants Lisa to change... \n",
"34 |Taking all that was great from the first insta... ABCs OF DEATH 2 aims to be a wilder leaner faster paced and even more entertaining antholo... with a new crop of award-winning \n",
"74 |Two students from the Czech Film Academy commi... posters flyers with photos of fake Czech Dream products a promotional song an internet site \n",
"99 |Tad is a celebrity archeologist and adventurer... Tad is a Chicago construction worker. One day however he is mistaken for a real Professor and takes h... Sara is engaged to real-life hero Max Mordon \n",
"\n",
" overview \\\n",
"1 |When Lou who has become the \"father of the Internet is shot by an unknown assailant, Jacob and Nick... director Christopher Guest reunites the team fr... get back on the stage for one concert in New ... \n",
"17 |After attending the funeral of her grandmother... the Lux Atlantic Hotel manager Lisa is waiting ... she meets in the airport bar Jack Rippner who is also in the waiting list. They sit toget... Lisa's father will be killed by a hit man. Li... \n",
"34 |Taking all that was great from the first insta... ABCs OF DEATH 2 aims to be a wilder leaner faster paced and even more entertaining antholo... visionary filmmakers from around the globe. \n",
"74 |Two students from the Czech Film Academy commi... posters flyers with photos of fake Czech Dream products a promotional song and ads in newspapers and magazines. Will peo... \n",
"99 |Tad is a celebrity archeologist and adventurer... Tad is a Chicago construction worker. One day however he is mistaken for a real Professor and takes h... but Max has secretly betrayed the Professor b... \n",
"\n",
" genre_Drama \n",
"1 |When Lou who has become the \"father of the Internet is shot by an unknown assailant, Jacob and Nick... director Christopher Guest reunites the team fr... 0.0 \n",
"17 |After attending the funeral of her grandmother... the Lux Atlantic Hotel manager Lisa is waiting ... she meets in the airport bar Jack Rippner who is also in the waiting list. They sit toget... 0.0 \n",
"34 |Taking all that was great from the first insta... ABCs OF DEATH 2 aims to be a wilder leaner faster paced and even more entertaining antholo... 0.0 \n",
"74 |Two students from the Czech Film Academy commi... posters flyers with photos of fake Czech Dream products a promotional song 0.0 \n",
"99 |Tad is a celebrity archeologist and adventurer... Tad is a Chicago construction worker. One day however he is mistaken for a real Professor and takes h... 0.0 "
],
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>overview</th>\n",
" <th>genre_Drama</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <th>|When Lou</th>\n",
" <th>who has become the \"father of the Internet</th>\n",
" <th>is shot by an unknown assailant, Jacob and Nick fire up the time machine again to save their friend.|,0\\r\\n2,|Mia Thermopolis is now a college graduate and on her way to Genovia to take up her duties as princess. Her best friend Lilly also joins her for the summer. Mia continues her 'princess lessons'- riding horses side-saddle, archery, and other royal. But her complicated life is turned upside down once again when she not only learns that she is to take the crown as queen earlier than expected...|,1\\r\\n3,|Under the direction of a ruthless instructor, a talented young drummer begins to pursue perfection at any cost, even his humanity.|,1\\r\\n4,|Vidya Bagchi (Vidya Balan) arrives in Kolkata from London to find her missing husband Arnab Bagchi. Seven months pregnant and alone in a festive city, she begins a relentless search for her husband. With nothing to rely on except fragments from her memories about him, all clues seem to reach a dead end when everyone tries to convince Vidya that her husband does not exist. She slowly realises that nothing is what it seems. In a city soaked in lies, Vidya is determined to unravel the truth about her husband - for herself and her unborn child - even at the cost of her own life.|,1\\r\\n5,|Marine Boy is the story of a former national swimmer who finds himself in debt, and out of desperation is employed as a mule by a gangster boss, smuggling drugs by sea.|,0\\r\\n6,|Pinocchio and his friends, a glow worm and a marionette, search for a magic music box. However, so are the evil Scalawag and the Emperor of the Night.|,0\\r\\n7,|A young girl buys an antique box at a yard sale, unaware that inside the collectible lives a malicious ancient spirit. The girl's father teams with his ex-wife to find a way to end the curse upon their child.|,0\\r\\n8,|A chronicle which provides a rare window into the international perception of the Iraq War, courtesy of Al Jazeera, the Arab world's most popular news outlet. Roundly criticized by Cabinet members and Pentagon officials for reporting with a pro-Iraqi bias, and strongly condemned for frequently airing civilian causalities as well as footage of American POWs, the station has revealed (and continues to show the world) everything about the Iraq War that the Bush administration did not want it to see.|,0\\r\\n9,|After telling the story of Flint's last journey to young Jim Hawkins, Billy Bones has a heart attack and dies just as Jim and his friends are attacked by pirates. The gang escapes into the town where they hire out a boat and crew to find the hidden treasure, which was revealed by Bones before he died. On their voyage across the seas, they soon find out that not everyone on board can be trusted.|,0\\r\\n10,|In A Mighty Wind\"</th>\n",
" <th>director Christopher Guest reunites the team from \"Best In Show\" and \"Waiting for Guffman\" to tell tell the story of 60's-era folk musicians</th>\n",
" <td>who inspired by the death of their former man...</td>\n",
" <td>get back on the stage for one concert in New ...</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <th>|After attending the funeral of her grandmother in Dallas</th>\n",
" <th>the Lux Atlantic Hotel manager Lisa is waiting for a flight to Miami. Due to the bad weather and consequent flight delay</th>\n",
" <th>she meets in the airport bar Jack Rippner</th>\n",
" <th>who is also in the waiting list. They sit together in the plane</th>\n",
" <td>and Jack reveals that he wants Lisa to change...</td>\n",
" <td>Lisa's father will be killed by a hit man. Li...</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <th>|Taking all that was great from the first installment</th>\n",
" <th>ABCs OF DEATH 2 aims to be a wilder</th>\n",
" <th>leaner</th>\n",
" <th>faster paced and even more entertaining anthology this time around</th>\n",
" <td>with a new crop of award-winning</td>\n",
" <td>visionary filmmakers from around the globe.</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>74</th>\n",
" <th>|Two students from the Czech Film Academy commission a leading advertising agency to organize a huge campaign for the opening of a new supermarket named Czech Dream. The supermarket however does not exist and is not meant to. The advertising campaign includes radio and television ads</th>\n",
" <th>posters</th>\n",
" <th>flyers with photos of fake Czech Dream products</th>\n",
" <th>a promotional song</th>\n",
" <td>an internet site</td>\n",
" <td>and ads in newspapers and magazines. Will peo...</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>99</th>\n",
" <th>|Tad is a celebrity archeologist and adventurer just like his hero Max Mordon... in his dreams! In reality</th>\n",
" <th>Tad is a Chicago construction worker. One day</th>\n",
" <th>however</th>\n",
" <th>he is mistaken for a real Professor and takes his place on a flight to Peru in search of the Lost City of Paititi. Professor Lavrof and his beautiful daughter Sara are waiting for the famous professor to crack the code. Unfortunately for Tad</th>\n",
" <td>Sara is engaged to real-life hero Max Mordon</td>\n",
" <td>but Max has secretly betrayed the Professor b...</td>\n",
" random_state=42))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\"> Pipeline<a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.5/modules/generated/sklearn.pipeline.Pipeline.html\">?<span>Documentation for Pipeline</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></label><div class=\"sk-toggleable__content fitted\"><pre>Pipeline(steps=[('tfidf',\n",
1 |When Lou who has become the "father of the Internet is shot by an unknown assailant, Jacob and Nick... director Christopher Guest reunites the team fr... who inspired by the death of their former man...
17 |After attending the funeral of her grandmother... the Lux Atlantic Hotel manager Lisa is waiting ... she meets in the airport bar Jack Rippner who is also in the waiting list. They sit toget... and Jack reveals that he wants Lisa to change...
34 |Taking all that was great from the first insta... ABCs OF DEATH 2 aims to be a wilder leaner faster paced and even more entertaining antholo... with a new crop of award-winning
74 |Two students from the Czech Film Academy commi... posters flyers with photos of fake Czech Dream products a promotional song an internet site
99 |Tad is a celebrity archeologist and adventurer... Tad is a Chicago construction worker. One day however he is mistaken for a real Professor and takes h... Sara is engaged to real-life hero Max Mordon
overview \
1 |When Lou who has become the "father of the Internet is shot by an unknown assailant, Jacob and Nick... director Christopher Guest reunites the team fr... get back on the stage for one concert in New ...
17 |After attending the funeral of her grandmother... the Lux Atlantic Hotel manager Lisa is waiting ... she meets in the airport bar Jack Rippner who is also in the waiting list. They sit toget... Lisa's father will be killed by a hit man. Li...
34 |Taking all that was great from the first insta... ABCs OF DEATH 2 aims to be a wilder leaner faster paced and even more entertaining antholo... visionary filmmakers from around the globe.
74 |Two students from the Czech Film Academy commi... posters flyers with photos of fake Czech Dream products a promotional song and ads in newspapers and magazines. Will peo...
99 |Tad is a celebrity archeologist and adventurer... Tad is a Chicago construction worker. One day however he is mistaken for a real Professor and takes h... but Max has secretly betrayed the Professor b...
genre_Drama
1 |When Lou who has become the "father of the Internet is shot by an unknown assailant, Jacob and Nick... director Christopher Guest reunites the team fr... 0.0
17 |After attending the funeral of her grandmother... the Lux Atlantic Hotel manager Lisa is waiting ... she meets in the airport bar Jack Rippner who is also in the waiting list. They sit toget... 0.0
34 |Taking all that was great from the first insta... ABCs OF DEATH 2 aims to be a wilder leaner faster paced and even more entertaining antholo... 0.0
74 |Two students from the Czech Film Academy commi... posters flyers with photos of fake Czech Dream products a promotional song 0.0
99 |Tad is a celebrity archeologist and adventurer... Tad is a Chicago construction worker. One day however he is mistaken for a real Professor and takes h... 0.0