Skip to content

Instantly share code, notes, and snippets.

@Thulana2006
Last active March 16, 2024 03:01
Show Gist options
  • Save Thulana2006/78f0d014cf191b51c5da79216c04819d to your computer and use it in GitHub Desktop.
Save Thulana2006/78f0d014cf191b51c5da79216c04819d to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "kYn0D5aMxeUn",
"outputId": "3b00d76e-4314-471c-9929-68db6f59a45f"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (2.31.0)\n",
"Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.10/dist-packages (4.12.3)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests) (3.3.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests) (3.6)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests) (2.0.7)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests) (2024.2.2)\n",
"Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4) (2.5)\n"
]
}
],
"source": [
"pip install requests beautifulsoup4\n"
]
},
{
"cell_type": "code",
"source": [
"import pandas as pd"
],
"metadata": {
"id": "o-bECX9Fp5p-"
},
"execution_count": 2,
"outputs": []
},
{
"cell_type": "code",
"source": [
"import requests\n",
"from bs4 import BeautifulSoup\n",
"\n",
"# Define the URL\n",
"urls = []\n",
"at_home_url = \"https://www.rottentomatoes.com/browse/movies_at_home/\"\n",
"in_theaters_url = \"https://www.rottentomatoes.com/browse/movies_in_theaters/\"\n",
"tv_series_url = \"https://www.rottentomatoes.com/browse/tv_series_browse/\"\n",
"coming_soon_url = \"https://www.rottentomatoes.com/browse/movies_coming_soon/\"\n",
"\n",
"urls = [[at_home_url,'At_home'],[in_theaters_url,'In_theaters'],[tv_series_url,'TV_series'],[coming_soon_url,'Coming_soon']]\n",
"df_list = []\n",
"\n",
"for url in urls:\n",
" # Send an HTTP GET request to the URL\n",
" response = requests.get(url[0])\n",
" print(url[0])\n",
" # Check if the request was successful\n",
" if response.status_code == 200:\n",
" # Parse the HTML content of the page\n",
" soup = BeautifulSoup(response.content, \"html.parser\")\n",
"\n",
" # Find all movie containers on the page\n",
" movie_containers = soup.find_all(\"div\", class_=\"discovery-tiles__wrap\")[0]\n",
"\n",
" #the list to store extracting data\n",
" movie_lst = []\n",
"\n",
" # Loop through each movie container and extract the desired information\n",
" for movie_container in movie_containers:\n",
" if(type(movie_container).__name__ == 'Tag'):\n",
" # temp list per movie\n",
" temp = []\n",
" #Extract the Screen Status\n",
" temp.append(url[1])\n",
" # Extract the movie name\n",
" movie_name = movie_container.find(\"span\", class_=\"p--small\").text.strip()\n",
" temp.append(movie_name)\n",
" # Extract the Tomatometer rating\n",
" tomatometer_rating = movie_container.find(\"score-pairs-deprecated\").attrs['criticsscore']\n",
" temp.append(tomatometer_rating)\n",
" # Extract the Audience Score\n",
" audience_score = movie_container.find(\"score-pairs-deprecated\").attrs['audiencescore']\n",
" temp.append(audience_score)\n",
" # Print the extracted information for testing\n",
" print(\"Screen Status: \", url[1])\n",
" print(\"Movie Name:\", movie_name)\n",
" print(\"Tomatometer Rating:\", tomatometer_rating)\n",
" print(\"Audience Score:\", audience_score)\n",
" movie_lst.append(temp)\n",
" else:\n",
" print(\"Failed to retrieve the webpage. Status code:\", response.status_code)\n",
" #print(movie_lst)\n",
" df = pd.DataFrame(movie_lst, columns=['Screen_Status','Movie_Name', 'Tomatometer_Reading ', 'Audience_Score'])\n",
"\n",
" df_list.append(df)\n",
"print(df_list[3])#testing\n",
"\n"
],
"metadata": {
"id": "M7uKvl-MSRqZ",
"outputId": "b39759c4-35ba-4572-a3b4-d2941a81aef5",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"https://www.rottentomatoes.com/browse/movies_at_home/\n",
"Screen Status: At_home\n",
"Movie Name: Argylle\n",
"Tomatometer Rating: 33\n",
"Audience Score: 72\n",
"Screen Status: At_home\n",
"Movie Name: Before I Change My Mind\n",
"Tomatometer Rating: 100\n",
"Audience Score: 43\n",
"Screen Status: At_home\n",
"Movie Name: Perfect Days\n",
"Tomatometer Rating: 96\n",
"Audience Score: 90\n",
"Screen Status: At_home\n",
"Movie Name: A Revolution on Canvas\n",
"Tomatometer Rating: 100\n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: T-Blockers\n",
"Tomatometer Rating: 100\n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: Hannah Gadsby's Gender Agenda\n",
"Tomatometer Rating: \n",
"Audience Score: 29\n",
"Screen Status: At_home\n",
"Movie Name: Cover Your Ears\n",
"Tomatometer Rating: \n",
"Audience Score: 100\n",
"Screen Status: At_home\n",
"Movie Name: Penelope My Love\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: The Troubles: A Dublin Story\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: Bella\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: Ricky Stanicky\n",
"Tomatometer Rating: 50\n",
"Audience Score: 71\n",
"Screen Status: At_home\n",
"Movie Name: The Thundermans Return\n",
"Tomatometer Rating: \n",
"Audience Score: 84\n",
"Screen Status: At_home\n",
"Movie Name: Damsel\n",
"Tomatometer Rating: 59\n",
"Audience Score: 76\n",
"Screen Status: At_home\n",
"Movie Name: Space: The Longest Goodbye\n",
"Tomatometer Rating: 77\n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: 5lbs of Pressure\n",
"Tomatometer Rating: 67\n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: American Dreamer\n",
"Tomatometer Rating: 39\n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: Night Shift\n",
"Tomatometer Rating: 20\n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: Frogman\n",
"Tomatometer Rating: 100\n",
"Audience Score: 83\n",
"Screen Status: At_home\n",
"Movie Name: First Time Female Director\n",
"Tomatometer Rating: 45\n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: The Piper\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: The Ballad of Davy Crockett\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: The Princess Warrior\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: At_home\n",
"Movie Name: Spaceman\n",
"Tomatometer Rating: 53\n",
"Audience Score: 65\n",
"Screen Status: At_home\n",
"Movie Name: Dune\n",
"Tomatometer Rating: 83\n",
"Audience Score: 90\n",
"Screen Status: At_home\n",
"Movie Name: Megamind vs. the Doom Syndicate\n",
"Tomatometer Rating: 0\n",
"Audience Score: 7\n",
"Screen Status: At_home\n",
"Movie Name: Poor Things\n",
"Tomatometer Rating: 92\n",
"Audience Score: 79\n",
"Screen Status: At_home\n",
"Movie Name: The Greatest Love Story Never Told\n",
"Tomatometer Rating: 100\n",
"Audience Score: 93\n",
"Screen Status: At_home\n",
"Movie Name: Monster\n",
"Tomatometer Rating: 96\n",
"Audience Score: 91\n",
"https://www.rottentomatoes.com/browse/movies_in_theaters/\n",
"Screen Status: In_theaters\n",
"Movie Name: Labyrinth\n",
"Tomatometer Rating: 77\n",
"Audience Score: 86\n",
"Screen Status: In_theaters\n",
"Movie Name: Shaitaan\n",
"Tomatometer Rating: 56\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: A Stage of Twilight\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Thankamani\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Kung Fu Panda 4\n",
"Tomatometer Rating: 70\n",
"Audience Score: 84\n",
"Screen Status: In_theaters\n",
"Movie Name: Cabrini\n",
"Tomatometer Rating: 89\n",
"Audience Score: 97\n",
"Screen Status: In_theaters\n",
"Movie Name: Imaginary\n",
"Tomatometer Rating: 33\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Damsel\n",
"Tomatometer Rating: 59\n",
"Audience Score: 75\n",
"Screen Status: In_theaters\n",
"Movie Name: Space: The Longest Goodbye\n",
"Tomatometer Rating: 77\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: 5lbs of Pressure\n",
"Tomatometer Rating: 67\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Glitter & Doom\n",
"Tomatometer Rating: 53\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: American Dreamer\n",
"Tomatometer Rating: 39\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Accidental Texan\n",
"Tomatometer Rating: 57\n",
"Audience Score: 100\n",
"Screen Status: In_theaters\n",
"Movie Name: Night Shift\n",
"Tomatometer Rating: 20\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: High & Low - John Galliano\n",
"Tomatometer Rating: 78\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: The Piper\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: YOLO\n",
"Tomatometer Rating: \n",
"Audience Score: 100\n",
"Screen Status: In_theaters\n",
"Movie Name: The Ballad of Davy Crockett\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Unfriending\n",
"Tomatometer Rating: 83\n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Gaami\n",
"Tomatometer Rating: \n",
"Audience Score: 30\n",
"Screen Status: In_theaters\n",
"Movie Name: Premalu\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: One Hand Don't Clap\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Nalla Perai Vaanga Vendum Pillaigale\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Bhimaa\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Agastya: Chapter 1\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Babu (No. 1 Bullshit Guy)\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Ranganayaka\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: In_theaters\n",
"Movie Name: Blackia 2\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"https://www.rottentomatoes.com/browse/tv_series_browse/\n",
"Screen Status: TV_series\n",
"Movie Name: Shōgun\n",
"Tomatometer Rating: 99\n",
"Audience Score: 94\n",
"Screen Status: TV_series\n",
"Movie Name: The Tourist\n",
"Tomatometer Rating: 96\n",
"Audience Score: 61\n",
"Screen Status: TV_series\n",
"Movie Name: The Gentlemen\n",
"Tomatometer Rating: 74\n",
"Audience Score: 77\n",
"Screen Status: TV_series\n",
"Movie Name: Avatar: The Last Airbender\n",
"Tomatometer Rating: 59\n",
"Audience Score: 75\n",
"Screen Status: TV_series\n",
"Movie Name: The Regime\n",
"Tomatometer Rating: 58\n",
"Audience Score: 55\n",
"Screen Status: TV_series\n",
"Movie Name: One Day\n",
"Tomatometer Rating: 91\n",
"Audience Score: 85\n",
"Screen Status: TV_series\n",
"Movie Name: The Walking Dead: The Ones Who Live\n",
"Tomatometer Rating: 90\n",
"Audience Score: 94\n",
"Screen Status: TV_series\n",
"Movie Name: House of Ninjas\n",
"Tomatometer Rating: 100\n",
"Audience Score: 91\n",
"Screen Status: TV_series\n",
"Movie Name: American Conspiracy: The Octopus Murders\n",
"Tomatometer Rating: 88\n",
"Audience Score: 54\n",
"Screen Status: TV_series\n",
"Movie Name: True Detective\n",
"Tomatometer Rating: 78\n",
"Audience Score: 56\n",
"Screen Status: TV_series\n",
"Movie Name: Halo\n",
"Tomatometer Rating: 82\n",
"Audience Score: 60\n",
"Screen Status: TV_series\n",
"Movie Name: Constellation\n",
"Tomatometer Rating: 71\n",
"Audience Score: 79\n",
"Screen Status: TV_series\n",
"Movie Name: Mary & George\n",
"Tomatometer Rating: 91\n",
"Audience Score: 78\n",
"Screen Status: TV_series\n",
"Movie Name: Mr. & Mrs. Smith\n",
"Tomatometer Rating: 90\n",
"Audience Score: 66\n",
"Screen Status: TV_series\n",
"Movie Name: The Completely Made-Up Adventures of Dick Turpin\n",
"Tomatometer Rating: 85\n",
"Audience Score: 62\n",
"Screen Status: TV_series\n",
"Movie Name: Elsbeth\n",
"Tomatometer Rating: 91\n",
"Audience Score: 83\n",
"Screen Status: TV_series\n",
"Movie Name: Masters of the Air\n",
"Tomatometer Rating: 86\n",
"Audience Score: 68\n",
"Screen Status: TV_series\n",
"Movie Name: Expats\n",
"Tomatometer Rating: 84\n",
"Audience Score: 51\n",
"Screen Status: TV_series\n",
"Movie Name: Death and Other Details\n",
"Tomatometer Rating: 55\n",
"Audience Score: 68\n",
"Screen Status: TV_series\n",
"Movie Name: The New Look\n",
"Tomatometer Rating: 59\n",
"Audience Score: 67\n",
"Screen Status: TV_series\n",
"Movie Name: American Nightmare\n",
"Tomatometer Rating: 96\n",
"Audience Score: 87\n",
"Screen Status: TV_series\n",
"Movie Name: Iwájú\n",
"Tomatometer Rating: 100\n",
"Audience Score: 85\n",
"Screen Status: TV_series\n",
"Movie Name: Red Queen\n",
"Tomatometer Rating: \n",
"Audience Score: 40\n",
"Screen Status: TV_series\n",
"Movie Name: Star Wars: The Bad Batch\n",
"Tomatometer Rating: 87\n",
"Audience Score: 86\n",
"Screen Status: TV_series\n",
"Movie Name: Supersex\n",
"Tomatometer Rating: 83\n",
"Audience Score: 100\n",
"Screen Status: TV_series\n",
"Movie Name: Tokyo Vice\n",
"Tomatometer Rating: 88\n",
"Audience Score: 92\n",
"Screen Status: TV_series\n",
"Movie Name: Hazbin Hotel\n",
"Tomatometer Rating: 79\n",
"Audience Score: 88\n",
"Screen Status: TV_series\n",
"Movie Name: Griselda\n",
"Tomatometer Rating: 87\n",
"Audience Score: 71\n",
"https://www.rottentomatoes.com/browse/movies_coming_soon/\n",
"Screen Status: Coming_soon\n",
"Movie Name: Forty-Seven Days with Jesus\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: The Primevals\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Blackout\n",
"Tomatometer Rating: 83\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Love Lies Bleeding\n",
"Tomatometer Rating: 90\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: The American Society of Magical Negroes\n",
"Tomatometer Rating: 35\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Arthur the King\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: One Life\n",
"Tomatometer Rating: 91\n",
"Audience Score: 91\n",
"Screen Status: Coming_soon\n",
"Movie Name: The Prank\n",
"Tomatometer Rating: 41\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Exhuma\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: The Animal Kingdom\n",
"Tomatometer Rating: 80\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Snack Shack\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: French Girl\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Prey\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Uproar\n",
"Tomatometer Rating: 100\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Club Zero\n",
"Tomatometer Rating: 62\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Bad River\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Shirley\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Invader\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Le règne animal\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Remembering Gene Wilder\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: State of Consciousness\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: The Shadowless Tower\n",
"Tomatometer Rating: 85\n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Much Ado About Dying\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Pastor's Kid\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: The End of Evangelion\n",
"Tomatometer Rating: 90\n",
"Audience Score: 85\n",
"Screen Status: Coming_soon\n",
"Movie Name: The Ark and the Darkness\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Christspiracy\n",
"Tomatometer Rating: \n",
"Audience Score: \n",
"Screen Status: Coming_soon\n",
"Movie Name: Problemista\n",
"Tomatometer Rating: 90\n",
"Audience Score: 80\n",
" Screen_Status Movie_Name \\\n",
"0 Coming_soon Forty-Seven Days with Jesus \n",
"1 Coming_soon The Primevals \n",
"2 Coming_soon Blackout \n",
"3 Coming_soon Love Lies Bleeding \n",
"4 Coming_soon The American Society of Magical Negroes \n",
"5 Coming_soon Arthur the King \n",
"6 Coming_soon One Life \n",
"7 Coming_soon The Prank \n",
"8 Coming_soon Exhuma \n",
"9 Coming_soon The Animal Kingdom \n",
"10 Coming_soon Snack Shack \n",
"11 Coming_soon French Girl \n",
"12 Coming_soon Prey \n",
"13 Coming_soon Uproar \n",
"14 Coming_soon Club Zero \n",
"15 Coming_soon Bad River \n",
"16 Coming_soon Shirley \n",
"17 Coming_soon Invader \n",
"18 Coming_soon Le règne animal \n",
"19 Coming_soon Remembering Gene Wilder \n",
"20 Coming_soon State of Consciousness \n",
"21 Coming_soon The Shadowless Tower \n",
"22 Coming_soon Much Ado About Dying \n",
"23 Coming_soon Pastor's Kid \n",
"24 Coming_soon The End of Evangelion \n",
"25 Coming_soon The Ark and the Darkness \n",
"26 Coming_soon Christspiracy \n",
"27 Coming_soon Problemista \n",
"\n",
" Tomatometer_Reading Audience_Score \n",
"0 \n",
"1 \n",
"2 83 \n",
"3 90 \n",
"4 35 \n",
"5 \n",
"6 91 91 \n",
"7 41 \n",
"8 \n",
"9 80 \n",
"10 \n",
"11 \n",
"12 \n",
"13 100 \n",
"14 62 \n",
"15 \n",
"16 \n",
"17 \n",
"18 \n",
"19 \n",
"20 \n",
"21 85 \n",
"22 \n",
"23 \n",
"24 90 85 \n",
"25 \n",
"26 \n",
"27 90 80 \n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# Concatenate dataframes vertically using a loop\n",
"df_concatenated = pd.concat(df_list, ignore_index=True)\n",
"\n",
"# Print the concatenated dataframe\n",
"print(df_concatenated)\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "gI8Gbslr9i2t",
"outputId": "a7560673-d90c-409e-e564-b6cb93b46e2c"
},
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
" Screen_Status Movie_Name Tomatometer_Reading \\\n",
"0 At_home Argylle 33 \n",
"1 At_home Before I Change My Mind 100 \n",
"2 At_home Perfect Days 96 \n",
"3 At_home A Revolution on Canvas 100 \n",
"4 At_home T-Blockers 100 \n",
".. ... ... ... \n",
"107 Coming_soon Pastor's Kid \n",
"108 Coming_soon The End of Evangelion 90 \n",
"109 Coming_soon The Ark and the Darkness \n",
"110 Coming_soon Christspiracy \n",
"111 Coming_soon Problemista 90 \n",
"\n",
" Audience_Score \n",
"0 72 \n",
"1 43 \n",
"2 90 \n",
"3 \n",
"4 \n",
".. ... \n",
"107 \n",
"108 85 \n",
"109 \n",
"110 \n",
"111 80 \n",
"\n",
"[112 rows x 4 columns]\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"df_concatenated.shape"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "JC8S3OFU92QS",
"outputId": "7abce8ca-c163-492e-e935-0cc32a083f98"
},
"execution_count": 5,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"(112, 4)"
]
},
"metadata": {},
"execution_count": 5
}
]
},
{
"cell_type": "code",
"source": [
"unique_values = df_concatenated['Screen_Status'].unique()\n",
"print(unique_values)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "QvXq6JykuROA",
"outputId": "1bbc81bd-9d81-4c1f-ac8a-44c6c4e0413c"
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['At_home' 'In_theaters' 'TV_series' 'Coming_soon']\n"
]
}
]
}
]
}
@Thulana2006
Copy link
Author

data collection from web - rotentomatoes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment