{ "cells": [ { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: datasets in /opt/anaconda3/lib/python3.12/site-packages (2.21.0)\n", "Requirement already satisfied: filelock in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (3.13.1)\n", "Requirement already satisfied: numpy>=1.17 in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (1.26.4)\n", "Requirement already satisfied: pyarrow>=15.0.0 in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (17.0.0)\n", "Requirement already satisfied: dill<0.3.9,>=0.3.0 in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (0.3.8)\n", "Requirement already satisfied: pandas in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (2.2.2)\n", "Requirement already satisfied: requests>=2.32.2 in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (2.32.2)\n", "Requirement already satisfied: tqdm>=4.66.3 in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (4.66.4)\n", "Requirement already satisfied: xxhash in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (3.5.0)\n", "Requirement already satisfied: multiprocess in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (0.70.16)\n", "Requirement already satisfied: fsspec<=2024.6.1,>=2023.1.0 in /opt/anaconda3/lib/python3.12/site-packages (from fsspec[http]<=2024.6.1,>=2023.1.0->datasets) (2024.3.1)\n", "Requirement already satisfied: aiohttp in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (3.9.5)\n", "Requirement already satisfied: huggingface-hub>=0.21.2 in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (0.24.6)\n", "Requirement already satisfied: packaging in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (23.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /opt/anaconda3/lib/python3.12/site-packages (from datasets) (6.0.1)\n", "Requirement already satisfied: aiosignal>=1.1.2 in /opt/anaconda3/lib/python3.12/site-packages (from aiohttp->datasets) (1.2.0)\n", "Requirement already satisfied: attrs>=17.3.0 in /opt/anaconda3/lib/python3.12/site-packages (from aiohttp->datasets) (23.1.0)\n", "Requirement already satisfied: frozenlist>=1.1.1 in /opt/anaconda3/lib/python3.12/site-packages (from aiohttp->datasets) (1.4.0)\n", "Requirement already satisfied: multidict<7.0,>=4.5 in /opt/anaconda3/lib/python3.12/site-packages (from aiohttp->datasets) (6.0.4)\n", "Requirement already satisfied: yarl<2.0,>=1.0 in /opt/anaconda3/lib/python3.12/site-packages (from aiohttp->datasets) (1.9.3)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /opt/anaconda3/lib/python3.12/site-packages (from huggingface-hub>=0.21.2->datasets) (4.11.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /opt/anaconda3/lib/python3.12/site-packages (from requests>=2.32.2->datasets) (2.0.4)\n", "Requirement already satisfied: idna<4,>=2.5 in /opt/anaconda3/lib/python3.12/site-packages (from requests>=2.32.2->datasets) (3.7)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/anaconda3/lib/python3.12/site-packages (from requests>=2.32.2->datasets) (2.2.2)\n", "Requirement already satisfied: certifi>=2017.4.17 in /opt/anaconda3/lib/python3.12/site-packages (from requests>=2.32.2->datasets) (2024.7.4)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /opt/anaconda3/lib/python3.12/site-packages (from pandas->datasets) (2.9.0.post0)\n", "Requirement already satisfied: pytz>=2020.1 in /opt/anaconda3/lib/python3.12/site-packages (from pandas->datasets) (2024.1)\n", "Requirement already satisfied: tzdata>=2022.7 in /opt/anaconda3/lib/python3.12/site-packages (from pandas->datasets) (2023.3)\n", "Requirement already satisfied: six>=1.5 in /opt/anaconda3/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas->datasets) (1.16.0)\n", "Requirement already satisfied: pandas in /opt/anaconda3/lib/python3.12/site-packages (2.2.2)\n", "Requirement already satisfied: numpy>=1.26.0 in /opt/anaconda3/lib/python3.12/site-packages (from pandas) (1.26.4)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /opt/anaconda3/lib/python3.12/site-packages (from pandas) (2.9.0.post0)\n", "Requirement already satisfied: pytz>=2020.1 in /opt/anaconda3/lib/python3.12/site-packages (from pandas) (2024.1)\n", "Requirement already satisfied: tzdata>=2022.7 in /opt/anaconda3/lib/python3.12/site-packages (from pandas) (2023.3)\n", "Requirement already satisfied: six>=1.5 in /opt/anaconda3/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)\n" ] } ], "source": [ "!pip install datasets\n", "!pip install pandas" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import datasets" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6b5bdaff002a48109bf3e939a59b89f7", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading readme: 0%| | 0.00/31.0 [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "78f3ec42c8d4487caf3bbfe653d3d2ca", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading data: 0%| | 0.00/293k [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "db1bcb892ad3437292c3734acfdc3a57", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Generating train split: 0%| | 0/1000 [00:00, ? examples/s]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "dataset = datasets.load_dataset(\"seemasaharann/fortune1000-dataset\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "DatasetDict({\n", " train: Dataset({\n", " features: ['Rank', 'Company', 'Ticker', 'Sector', 'Industry', 'Profitable', 'Founder_is_CEO', 'FemaleCEO', 'Growth_in_Jobs', 'Change_in_Rank', 'Gained_in_Rank', 'Dropped_in_Rank', 'Newcomer_to_the_Fortune500', 'Global500', 'Worlds_Most_Admired_Companies', 'Best_Companies_to_Work_For', 'Number_of_employees', 'MarketCap_March28_M', 'Revenues_M', 'RevenuePercentChange', 'Profits_M', 'ProfitsPercentChange', 'Assets_M', 'CEO', 'Country', 'HeadquartersCity', 'HeadquartersState', 'Website', 'CompanyType', 'Footnote', 'MarketCap_Updated_M', 'Updated'],\n", " num_rows: 1000\n", " })\n", "})" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "test_dataset = dataset[\"train\"]" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Rank | \n", "Company | \n", "Ticker | \n", "Sector | \n", "Industry | \n", "Profitable | \n", "Founder_is_CEO | \n", "FemaleCEO | \n", "Growth_in_Jobs | \n", "Change_in_Rank | \n", "... | \n", "Assets_M | \n", "CEO | \n", "Country | \n", "HeadquartersCity | \n", "HeadquartersState | \n", "Website | \n", "CompanyType | \n", "Footnote | \n", "MarketCap_Updated_M | \n", "Updated | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "Walmart | \n", "WMT | \n", "Retailing | \n", "General Merchandisers | \n", "yes | \n", "no | \n", "no | \n", "no | \n", "0.0 | \n", "... | \n", "252399.0 | \n", "C. Douglas McMillon | \n", "U.S. | \n", "Bentonville | \n", "Arkansas | \n", "https://www.stock.walmart.com | \n", "Public | \n", "Figures are for fiscal year ended Jan. 31, 202... | \n", "559911.0 | \n", "2024-08-05 | \n", "
1 | \n", "2 | \n", "Amazon | \n", "AMZN | \n", "Retailing | \n", "Internet Services and Retailing | \n", "yes | \n", "no | \n", "no | \n", "no | \n", "0.0 | \n", "... | \n", "527854.0 | \n", "Andrew R. Jassy | \n", "U.S. | \n", "Seattle | \n", "Washington | \n", "https://www.amazon.com | \n", "Public | \n", "Market value as of July 15, 2024. | \n", "2005565.0 | \n", "2024-08-05 | \n", "
2 | \n", "3 | \n", "Apple | \n", "AAPL | \n", "Technology | \n", "Computers, Office Equipment | \n", "yes | \n", "no | \n", "no | \n", "no | \n", "1.0 | \n", "... | \n", "352583.0 | \n", "Timothy D. Cook | \n", "U.S. | \n", "Cupertino | \n", "California | \n", "https://www.apple.com | \n", "Public | \n", "Figures are for fiscal year ended Sept. 30, 20... | \n", "3594309.0 | \n", "2024-08-05 | \n", "
3 | \n", "4 | \n", "UnitedHealth Group | \n", "UNH | \n", "Health Care | \n", "Health Care: Insurance and Managed Care | \n", "yes | \n", "no | \n", "no | \n", "yes | \n", "1.0 | \n", "... | \n", "273720.0 | \n", "Andrew P. Witty | \n", "U.S. | \n", "Minnetonka | \n", "Minnesota | \n", "https://www.unitedhealthgroup.com | \n", "Public | \n", "Market value as of July 15, 2024. | \n", "474339.0 | \n", "2024-08-05 | \n", "
4 | \n", "5 | \n", "Berkshire Hathaway | \n", "BRKA | \n", "Financials | \n", "Insurance: Property and Casualty (Stock) | \n", "yes | \n", "no | \n", "no | \n", "yes | \n", "2.0 | \n", "... | \n", "1069978.0 | \n", "Warren E. Buffett | \n", "U.S. | \n", "Omaha | \n", "Nebraska | \n", "https://www.berkshirehathaway.com | \n", "Public | \n", "Market value as of July 15, 2024. | \n", "937028.0 | \n", "2024-08-05 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
995 | \n", "996 | \n", "Allegiant Travel | \n", "ALGT | \n", "Transportation | \n", "Airlines | \n", "yes | \n", "no | \n", "no | \n", "yes | \n", "0.0 | \n", "... | \n", "4869.4 | \n", "Maurice J. Gallagher Jr. | \n", "U.S. | \n", "Las Vegas | \n", "Nevada | \n", "https://www.allegiant.com | \n", "Public | \n", "Market value as of March 28, 2024. | \n", "1375.0 | \n", "2024-06-04 | \n", "
996 | \n", "997 | \n", "Dropbox | \n", "DBX | \n", "Technology | \n", "Computer Software | \n", "yes | \n", "yes | \n", "no | \n", "no | \n", "0.0 | \n", "... | \n", "2983.5 | \n", "Andrew W. Houston | \n", "U.S. | \n", "San Francisco | \n", "California | \n", "https://www.dropbox.com | \n", "Public | \n", "Market value as of March 28, 2024. | \n", "8359.0 | \n", "2024-06-04 | \n", "
997 | \n", "998 | \n", "Exact Sciences | \n", "EXAS | \n", "Health Care | \n", "Pharmaceuticals | \n", "no | \n", "no | \n", "no | \n", "yes | \n", "0.0 | \n", "... | \n", "6471.3 | \n", "Kevin T. Conroy | \n", "U.S. | \n", "Madison | \n", "Wisconsin | \n", "https://www.exactsciences.com | \n", "Public | \n", "Market value as of March 28, 2024. | \n", "12537.0 | \n", "2024-06-04 | \n", "
998 | \n", "999 | \n", "BWX Technologies | \n", "BWXT | \n", "Aerospace & Defense | \n", "Aerospace & Defense | \n", "yes | \n", "no | \n", "no | \n", "yes | \n", "0.0 | \n", "... | \n", "2747.1 | \n", "Rex D. Geveden | \n", "U.S. | \n", "Lynchburg | \n", "Virginia | \n", "https://www.bwxt.com | \n", "Public | \n", "Market value as of March 28, 2024. | \n", "9380.0 | \n", "2024-06-04 | \n", "
999 | \n", "1000 | \n", "Clear Channel Outdoor Hldgs. | \n", "CCO | \n", "Business Services | \n", "Advertising, marketing | \n", "no | \n", "no | \n", "no | \n", "no | \n", "-10.0 | \n", "... | \n", "4722.5 | \n", "Scott R. Wells | \n", "U.S. | \n", "San Antonio | \n", "Texas | \n", "https://www.clearchanneloutdoor.com | \n", "Public | \n", "Includes revenues from discontinued operations... | \n", "798.0 | \n", "2024-06-04 | \n", "
1000 rows × 32 columns
\n", "