{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Shawhin Talebi",
  "title_listed": "Python QuickStart for People Learning AI",
  "keywords": "Python,AI,入门",
  "domain": "机器学习",
  "content_type": "深度技术解析",
  "is_paid_flag": "部分免费/会员墙",
  "url": "https://towardsdatascience.com/python-quickstart-for-people-learning-ai-58a1b76df0f4/",
  "publish_date": "2024-09",
  "corpus_stage": "预训练/SFT",
  "notes": "",
  "id": "e8ede08d0dbe",
  "collected_at": "2026-10-01T22:33:19",
  "title": "Python QuickStart for People Learning AI | Towards Data Science",
  "body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# Python QuickStart for People Learning AI\nA beginner-friendly guide\n[Shaw Talebi](https://towardsdatascience.com/author/shawhin/)\nSeptember 8, 202413 min read\n![Image from Canva.](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/09/1-mbIMdku5V3kilFWTRHuLQ.png)\nImage from Canva.\nPython has become the de facto programming language for AI and data science. Although no-code solutions exist, learning how to code is still essential to build fully custom AI projects and products. In this article, I share a beginner QuickStart guide to AI development with Python. I'll cover the basics and then share a concrete example with code.\n* * *\n**Python** is a programming language, i.e., **a way to give computers precise instructions to do things we can't or don't want to do** [1].\nThis is handy when **automating a unique task without an off-the-shelf solution**. For example, if I wanted to automate writing and sending personalized meeting follow-ups, I could write a Python script to do this.\nWith tools like ChatGPT, it's easy to imagine a future where one could describe _any_ bespoke task in plain English, and the computer would just do it. However, such a consumer product does not exist right now. Until such products become available, there is tremendous value in knowing (at least a little) Python.\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) roadmap.\n## **Coding is Easier Than Ever**\nWhile current AI products (e.g. ChatGPT, Claude, Gemini) haven't made programming obsolete (yet), they have made it easier than ever to learn how to code. We all now have a competent and patient coding assistant who is always available to help us learn.\nCombined with the \"traditional\" approach of Googling all your problems, **programmers can now move faster**. For instance, I generously use ChatGPT to write example code and explain error messages. This accelerates my progress and gives me more confidence when navigating new technology stacks.\n## **Who This is For**\nI'm writing this with a particular type of reader in mind: those **trying to get into AI and have done a little coding** (e.g., JS, HTML/CSS, PHP, Java, SQL, Bash/Powershell, VBA) **but are new to Python**.\nI'll start with Python fundamentals, then share example code for a simple AI project. This is not meant to be a comprehensive introduction to Python. Rather, it's **meant to give you just enough to code your first AI project with Python fast**.\n_About me - I'm a data scientist and self-taught Python programmer (5 years). While there's still much for me to learn about software development, here I cover what I think are the bare essentials of Python for AI/data science projects based on my personal experience._\n* * *\n## **Installing Python**\nMany computers come with Python pre-installed. To see if your machine has it, go to your Terminal (Mac/Linux) or Command Prompt (Windows), and simply enter \"python\".\n![Using Python in Terminal. Image by author.](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/09/1WLRwkH-uTeg1b2ndgVFERQ.png)\nUsing Python in Terminal. Image by author.\nIf you don't see a screen like this, you can download Python manually ([Windows](https://docs.python.org/3/using/windows.html)/ [Mac](https://docs.python.org/3/using/mac.html)). Alternatively, one can install [Anaconda](https://www.anaconda.com/download/success), a popular Python package system for AI and data science. If you run into installation issues, **ask your favorite AI assistant for help!**\nWith Python running, we can now start writing some code. **I recommend running the examples on your computer as we go along**. You can also download all the example code from the [GitHub repo](https://github.com/ShawhinT/YouTube-Blog/tree/main/python-quickstart).\n## **1) Data Types**\n### **Strings & Numbers**\nA **data type** (or just \"type\") is **a way to classify data so that it can be processed appropriately and efficiently in a computer**.\nTypes are defined by a possible set of values and operations. For example, **strings** are **arbitrary character sequences** (i.e. text) that can be manipulated in specific ways. Try the following strings in your command line Python instance.\npython-repl\n\n```\n\"this is a string\">> 'this is a string'\n```\n\npython-repl\n\n```\n'so is this:-1*!@&amp;04\"(*&amp;^}\":>?'>> 'so is this:-1*!@&amp;04\"(*&amp;^}\":>?'\n```\n\npython-repl\n\n```\n\"\"\"and    this is        too!!11!\"\"\">> 'andn    this isn        too!!11!'\n```\n\npython-repl\n\n```\n\"we can even \" + \"add strings together\">> 'we can even add strings together'\n```\n\nAlthough strings can be added together (i.e. concatenated), they can't be added to **numerical data types** like **int (i.e. integers)** or **float (i.e. numbers with decimals)**. If we try that in Python, we will get an error message because operations are only defined for compatible types.\npython-repl\n\n```\n# we can't add strings to other data types (BTW this is how you write comments in Python)\"I am \" + 29>> TypeError: can only concatenate str (not \"int\") to str\n```\n\npython-repl\n\n```\n# so we have to write 29 as a string\"I am \" + \"29\">> 'I am 29'\n```\n\n### **Lists & Dictionaries**\nBeyond the basic types of strings, ints, and floats, Python has types for structuring larger collections of data.\nOne such type is a **list** , an **ordered collection of values**. We can have lists of strings, numbers, strings **+** numbers, or even lists of lists.\npython\n\n```\n# a list of strings\n[\"a\", \"b\", \"c\"]\n\n# a list of ints\n[1, 2, 3]\n\n# list with a string, int, and float\n[\"a\", 2, 3.14]\n\n# a list of lists\n[[\"a\", \"b\"], [1, 2], [1.0, 2.0]]\n```\n\nAnother core data type is a **dictionary** , which consists of **key-value pair sequences** where **keys are strings** and **values can be any data type**. This is a great way to represent data with multiple attributes.\npython\n\n```\n# a dictionary\n{\"Name\":\"Shaw\"}\n\n# a dictionary with multiple key-value pairs\n{\"Name\":\"Shaw\", \"Age\":29, \"Interests\":[\"AI\", \"Music\", \"Bread\"]}\n\n# a list of dictionaries\n[{\"Name\":\"Shaw\", \"Age\":29, \"Interests\":[\"AI\", \"Music\", \"Bread\"]}, \n {\"Name\":\"Ify\", \"Age\":27, \"Interests\":[\"Marketing\", \"YouTube\", \"Shopping\"]}]\n\n# a nested dictionary\n{\"User\":{\"Name\":\"Shaw\", \"Age\":29, \"Interests\":[\"AI\", \"Music\", \"Bread\"]}, \n \"Last_login\":\"2024-09-06\", \n \"Membership_Tier\":\"Free\"}\n```\n\n## **2) Variables**\nSo far, we've seen some basic Python data types and operations. However, we are still missing an essential feature: variables.\n**Variables** provide **an abstract representation of an underlying data type instance**. For example, I might create a variable called user_name, which represents a string containing my name, \"Shaw.\" This enables us to write flexible programs not limited to specific values.\npython\n\n```\n# creating a variable and printing it\nuser_name = \"Shaw\"\nprint(user_name)\n\n#>> Shaw\n```\n\nWe can do the same thing with other data types e.g. ints and lists.\npython\n\n```\n# defining more variables and printing them as a formatted string. \nuser_age = 29\nuser_interests = [\"AI\", \"Music\", \"Bread\"]\n\nprint(f\"{user_name} is {user_age} years old. His interests include {user_interests}.\")\n\n#>> Shaw is 29 years old. His interests include ['AI', 'Music', 'Bread'].\n```\n\n## **3) Creating Scripts**\nNow that our example code snippets are getting longer, let's see how to create our first script. This is how we **write and execute more sophisticated programs from the command line**.\nTo do that, create a new folder on your computer. I'll call mine _python-quickstart_. If you have a favorite **IDE (e.g., the Integrated Development Environment)** , use that to open this new folder and create a new Python file, e.g., my-script.py. There, we can write the ceremonial \"Hello, world\" program.\npython\n\n```\n# ceremonial first program\nprint(\"Hello, world!\")\n```\n\nIf you don't have an IDE (not recommended), you can use a basic text editor (e.g. Apple's Text Edit, Window's Notepad). In those cases, you can **open the text editor and save a new text file using the .py extension instead of .txt.** _Note: If you use TextEditor on Mac, you may need to put the application in plain text mode via Format > Make Plain Text._\nWe can then run this script using the Terminal (Mac/Linux) or Command Prompt (Windows) by navigating to the folder with our new Python file and running the following command.\nbash\n\n```\npython my-script.py\n```\n\nCongrats! You ran your first Python script. Feel free to **expand this program by copy-pasting the upcoming code examples and rerunning the script** to see their outputs.\n## **4) Loops and Conditions**\nTwo fundamental functionalities of Python (or any other programming language) are loops and conditions.\n**Loops** allow us to **run a particular chunk of code multiple times**. The most popular is the **for loop** , which runs the same code while iterating over a variable.\npython\n\n```\n# a simple for loop iterating over a sequence of numbers\nfor i in range(5):\n    print(i) # print ith element\n\n# for loop iterating over a list\nuser_interests = [\"AI\", \"Music\", \"Bread\"]\n\nfor interest in user_interests:\n    print(interest) # print each item in list\n\n# for loop iterating over items in a dictionary\nuser_dict = {\"Name\":\"Shaw\", \"Age\":29, \"Interests\":[\"AI\", \"Music\", \"Bread\"]}\n\nfor key, value in user_dict.items():\n    print(key, \"=\", value) # print each key and corresponding value\n```\n\nThe other core function is **conditions** , such as if-else statements, which **enable us to program logic**. For example, we may want to check if the user is an adult or evaluate their wisdom.\nbash\n\n```\n# check if user is 18 or older\nif user_dict[\"Age\"] >= 18:\n    print(\"User is an adult\")\n\n# check if user is 1000 or older, if not print they have much to learn\nif user_dict[\"Age\"] >= 1000:\n    print(\"User is wise\")\nelse:\n    print(\"User has much to learn\")\n```\n\nIt's common to **use conditionals within for loops** to apply different operations based on specific conditions, such as counting the number of users interested in bread.\npython\n\n```\n# count the number of users interested in bread\nuser_list = [{\"Name\":\"Shaw\", \"Age\":29, \"Interests\":[\"AI\", \"Music\", \"Bread\"]}, \n             {\"Name\":\"Ify\", \"Age\":27, \"Interests\":[\"Marketing\", \"YouTube\", \"Shopping\"]}]\ncount = 0 # intialize count\n\nfor user in user_list:\n    if \"Bread\" in user[\"Interests\"]:\n        count = count + 1 # update count\n\nprint(count, \"user(s) interested in Bread\")\n```\n\n## **5) Functions**\n**Functions** are **operations we can perform on specific data types**.\nWe've already seen a basic function _print()_ , which is defined for any datatype. However, there are a few other handy ones worth knowing.\npython\n\n```\n# print(), a function we've used several times already\nfor key in user_dict.keys():\n    print(key, \":\", user_dict[key])\n\n# type(), getting the data type of a variable\nfor key in user_dict.keys():\n    print(key, \":\", type(user_dict[key]))\n\n# len(), getting the length of a variable\nfor key in user_dict.keys():\n    print(key, \":\", len(user_dict[key]))\n# TypeError: object of type 'int' has no len()\n```\n\nWe see that, unlike _print()_ and _type()_ , _len()_ is not defined for all data types, so it throws an error when applied to an int. There are several other **type-specific functions** like this.\nbash\n\n```\n# string methods\n# --------------\n# make string all lowercase\nprint(user_dict[\"Name\"].lower())\n\n# make string all uppercase\nprint(user_dict[\"Name\"].upper())\n\n# split string into list based on a specific character sequence\nprint(user_dict[\"Name\"].split(\"ha\"))\n\n# replace a character sequence with another\nprint(user_dict[\"Name\"].replace(\"w\", \"whin\"))\n```\n\nbash\n\n```\n# list methods\n# ------------\n# add an element to the end of a list\nuser_dict[\"Interests\"].append(\"Entrepreneurship\")\nprint(user_dict[\"Interests\"])\n\n# remove a specific element from a list\nuser_dict[\"Interests\"].pop(0)\nprint(user_dict[\"Interests\"])\n\n# insert an element into a specific place in a list\nuser_dict[\"Interests\"].insert(1, \"AI\")\nprint(user_dict[\"Interests\"])\n```\n\npython\n\n```\n# dict methods\n# ------------\n# accessing dict keys\nprint(user_dict.keys())\n\n# accessing dict values\nprint(user_dict.values())\n\n# accessing dict items\nprint(user_dict.items())\n\n# removing a key\nuser_dict.pop(\"Name\")\nprint(user_dict.items())\n\n# adding a key\nuser_dict[\"Name\"] = \"Shaw\"\nprint(user_dict.items())\n```\n\nWhile the core Python functions are helpful, the real power comes from creating **user-defined functions** to **perform custom operations**. Additionally, custom functions allow us to write much cleaner code. For example, here are some of the previous code snippets repackaged as user-defined functions.\npython\n\n```\n# define a custom function\ndef user_description(user_dict):\n    \"\"\"\n        Function to return a sentence (string) describing input user\n    \"\"\"\n    return f'{user_dict[\"Name\"]} is {user_dict[\"Age\"]} years old and is interested in {user_dict[\"Interests\"][0]}.'\n\n# print user description\ndescription = user_description(user_dict)\nprint(description)\n\n# print description for a new user!\nnew_user_dict = {\"Name\":\"Ify\", \"Age\":27, \"Interests\":[\"Marketing\", \"YouTube\", \"Shopping\"]}\nprint(user_description(new_user_dict))\n```\n\npython\n\n```\n# define another custom function\ndef interested_user_count(user_list, topic):\n    \"\"\"\n        Function to count number of users interested in an arbitrary topic\n    \"\"\"\n    count = 0\n\n    for user in user_list:\n        if topic in user[\"Interests\"]:\n            count = count + 1\n\n    return count\n\n# define user list and topic\nuser_list = [user_dict, new_user_dict]\ntopic = \"Shopping\"\n\n# compute interested user count and print it\ncount = interested_user_count(user_list, topic)\nprint(f\"{count} user(s) interested in {topic}\")\n```\n\n## **6) Libraries, pip, & venv**\nAlthough we could implement an arbitrary program using core Python, this can be incredibly time-consuming for some use cases. One of Python's key benefits is its **vibrant developer community and a robust ecosystem of software packages**. Almost anything you might want to implement with core Python (probably) already exists as an open-source library.\nWe can install such packages using **Python's native package manager, pip**. To install new packages, we run pip commands from the command line. Here is how we can install **numpy** , **an essential data science library** that implements basic mathematical objects and operations.\npython\n\n```\npip install numpy\n```\n\nAfter we've installed numpy, we can import it into a new Python script and use some of its data types and functions.\npython\n\n```\nimport numpy as np\n\n# create a \"vector\"\nv = np.array([1, 3, 6])\nprint(v)\n\n# multiply a \"vector\"\nprint(2*v)\n\n# create a matrix\nX = np.array([v, 2*v, v/2])\nprint(X)\n\n# matrix multiplication\nprint(np.matmul(X,v))\n```\n\nThe previous pip command added numpy to our base Python environment. Alternatively, it's a best practice to create so-called **virtual environments**. These are **collections of Python libraries that can be readily interchanged for different projects**.\nHere's how to create a new virtual environment called _my-env_.\nbash\n\n```\npython -m venv my-env\n```\n\nThen, we can activate it.\nbash\n\n```\n# mac/linux\nsource my-env/bin/activate\n\n# windows\n.my-envScriptsactivate.bat\n```\n\nFinally, we can install new libraries, such as numpy, using pip.\nbash\n\n```\npip install numpy\n```\n\n_Note: If you're using Anaconda, check out this [handy cheatsheet](https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf) for creating a new conda environment._\nSeveral other libraries are commonly used in AI and data science. Here is a **non-comprehensive overview of some helpful ones for building AI projects**.\n![A non-comprehensive overview of Python libs for data science and AI. Image by author.](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/09/1j-6e7IPbjeLiN9kd52n-0Q.png)\nA non-comprehensive overview of Python libs for data science and AI. Image by author.\n## **Example Code: Extracting summary and keywords from research papers**\nNow that we have been exposed to the basics of Python, let's see how we can use it to implement a simple AI project. Here, I will use the OpenAI API to create a research paper summarizer and keyword extractor.\nLike all the other snippets in this guide, the example code is available at the [GitHub repository](https://github.com/ShawhinT/YouTube-Blog/tree/main/python-quickstart).\n* * *\n### Install Dependencies\nWe start by installing a few helpful libraries. You can use the same _my-env_ environment we created earlier or make a new one. Then, you can install all the required packages using the _requirements.txt_ file from the [GitHub repo](https://github.com/ShawhinT/YouTube-Blog/tree/main/python-quickstart).\ntypescript\n\n```\npip install -r requirements.txt\n```\n\nThis line of code scans each library listed in _requirements.txt_ and installs each.\n### Imports\nNext, we can create a new Python script and import the needed libraries.\npython\n\n```\nimport fitz  # PyMuPDF\nimport openai\nimport sys\n```\n\nNext, to use OpenAI's Python API, we will need to import an AI key. Here's one way to do that.\npython\n\n```\nfrom sk import my_sk\n\n# Set up your OpenAI API key\nopenai.api_key = my_sk\n```\n\nNote that _sk_ is not a Python library. Rather, it is a separate Python script that defines a single variable, _**my_sk** _, which is a **string consisting of my OpenAI API key** i.e. a unique (and secret) token allowing one to use OpenAI's API.\nI shared a beginner-friendly introduction to APIs, OpenAI's API, and setting up an API key in a [previous article](https://towardsdatascience.com/cracking-open-the-openai-python-api-230e4cae7971).\n> [**Cracking Open the OpenAI (Python) API**](https://towardsdatascience.com/cracking-open-the-openai-python-api-230e4cae7971)\n### Read PDF\nNext, we will create a function that, given the path to a research paper saved as a .pdf file, will extract the abstract from the paper.\npython\n\n```\n# Function to read the first page of a PDF and extract the abstract\ndef extract_abstract(pdf_path):\n\n    # Open the PDF file and grab text from the 1st page\n    with fitz.open(pdf_path) as pdf:\n        first_page = pdf[0]\n        text = first_page.get_text(\"text\")\n\n    # Extract the abstract (assuming the abstract starts with 'Abstract')\n\n    # find where abstract starts\n    start_idx = text.lower().find('abstract') \n\n    # end abstract at introduction if it exists on 1st page\n    if 'introduction' in text.lower():\n        end_idx = text.lower().find('introduction')  \n    else:\n        end_idx = None\n\n    # extract abstract text\n    abstract = text[start_idx:end_idx].strip()\n\n    # if abstract appears on 1st page return it, if not resturn None\n    if start_idx != -1:\n        abstract = text[start_idx:end_idx].strip()\n        return abstract\n    else:\n        return None\n```\n\n### Summarize with LLM\nNow that we have our abstract text, we can use an LLM to summarize it and generate keywords. Here, I define a function to pass an abstract to OpenAI's GPT-4o-mini model to do this.\npython\n\n```\n# Function to summarize the abstract and generate keywords using OpenAI API\ndef summarize_and_generate_keywords(abstract):\n\n    # Use OpenAI Chat Completions API to summarize and generate keywords\n    prompt = f\"Summarize the following paper abstract and generate (no more than 5) keywords:nn{abstract}\"\n\n    # make api call\n    response = openai.chat.completions.create(\n        model=\"gpt-4o-mini\",\n        messages=[\n            {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n            {\"role\": \"user\", \"content\": prompt}\n        ], \n        temperature = 0.25\n    )\n\n    # extract response\n    summary = response.choices[0].message.content\n    return summary\n```\n\n### Bring it all together\nFinally, we can use our user-defined functions to generate summaries and keywords for any research paper passed to the program from the command line.\npython\n\n```\n# Get the PDF path from the command-line arguments\npdf_path = sys.argv[1]\n\n# Extract abstract from the PDF\nabstract = extract_abstract(pdf_path)\n\n# if abstract exists on first page, print summary.\nif abstract:\n    # Summarize and generate keywords\n    summary = summarize_and_generate_keywords(abstract)\n\n    print(summary)\nelse:\n    print(\"Abstract not found on the first page.\")\n```\n\nWe can then execute our program from the command line.\nbash\n\n```\npython summarize-paper.py \"files/attention-is-all-you-need.pdf\"\n```\n\nplaintext\n\n```\nOutput:\nThe paper introduces the Transformer, a novel network architecture for sequence\ntransduction tasks that relies solely on attention mechanisms, eliminating the \nneed for recurrent and convolutional structures. The Transformer demonstrates \nsuperior performance in machine translation tasks, achieving a BLEU score of \n28.4 on the WMT 2014 English-to-German translation and a state-of-the-art \nscore of 41.8 on the English-to-French translation task, while also being more \nefficient in training time. Additionally, the Transformer shows versatility by \nsuccessfully applying to English constituency parsing with varying amounts of \ntraining data.\n\n**Keywords:** Transformer, attention mechanisms, machine translation, \nBLEU score, neural networks.\n```\n\n> [**YouTube-Blog/python-quickstart at main · ShawhinT/YouTube-Blog**](https://github.com/ShawhinT/YouTube-Blog/tree/main/python-quickstart)\n## What's Next?\nHere, we covered some Python fundamentals and implemented our first AI project! Although we covered a lot, there is still much more to learn.\nThe next step here is to implement your own AI project. This is the best way to keep learning. However, before we go, here are some tips.\n  * Use Google and ChatGPT _generously_ whenever you get stuck\n  * \"Figuring it out\" is a key skill you must develop as a programmer\n  * Check out the data scientist's favorite tool: [Jupyter Notebooks](https://jupyter.org/)\n  * Hack the example from this guide to get started!\n\n\n* * *\n**My website** : <https://www.shawhintalebi.com/>\n[1] [AI Python for Beginners](https://www.deeplearning.ai/short-courses/ai-python-for-beginners/)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657074748_utev3i.jpeg)\nWritten By\n## [Shaw Talebi](https://towardsdatascience.com/author/shawhin/)\n[See all from Shaw Talebi](https://towardsdatascience.com/author/shawhin/)\n[AI](https://towardsdatascience.com/tag/ai/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Llm](https://towardsdatascience.com/tag/llm/)[Python](https://towardsdatascience.com/tag/python/)[Python Programming](https://towardsdatascience.com/tag/python-programming/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fpython-quickstart-for-people-learning-ai-58a1b76df0f4%2F&title=Python%20QuickStart%20for%20People%20Learning%20AI)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fpython-quickstart-for-people-learning-ai-58a1b76df0f4%2F&title=Python%20QuickStart%20for%20People%20Learning%20AI)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fpython-quickstart-for-people-learning-ai-58a1b76df0f4%2F&text=Python%20QuickStart%20for%20People%20Learning%20AI)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://towardsdatascience.com/images/fallback-image.jpg)](https://towardsdatascience.com/interested-in-decision-intelligence-start-here-30ed4fec81fa/)\n## [Interested in Decision Intelligence? Start Here](https://towardsdatascience.com/interested-in-decision-intelligence-start-here-30ed4fec81fa/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\n\"Decision intelligence is the discipline of turning information into better actions at any scale.\" In this comprehensive 14-minute read...\n[Ludovic Benistant](https://towardsdatascience.com/author/ludobenistant/)\nApril 17, 20211 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2025/12/lakehpuse.jpg)](https://towardsdatascience.com/bootstrap-a-data-lakehouse-in-an-afternoon/)\n## [Bootstrap a Data Lakehouse in an Afternoon](https://towardsdatascience.com/bootstrap-a-data-lakehouse-in-an-afternoon/)\n[Data Engineering](https://towardsdatascience.com/category/data-science/data-engineering/)\nUsing Apache Iceberg on AWS with Athena, Glue/Spark and DuckDB\n[Thomas Reid](https://towardsdatascience.com/author/thomas_reid/)\nDecember 4, 202512 min read\n  * [![](https://towardsdatascience.com/images/fallback-image.jpg)](https://towardsdatascience.com/latest-picks-how-to-structure-your-data-science-workflow-1d1622a2e8ad/)\n## [Latest picks: How to Structure Your Data Science Workflow](https://towardsdatascience.com/latest-picks-how-to-structure-your-data-science-workflow-1d1622a2e8ad/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nYour daily dose of data science\n[TDS Editors](https://towardsdatascience.com/author/towardsdatascience/)\nDecember 1, 20201 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/1rv9kadG6E2Mgx3Os4kQNfQ-scaled.jpeg)](https://towardsdatascience.com/how-to-make-stunning-interactive-maps-with-python-and-folium-in-minutes-e3aff3b0ed43/)\n## [How to Make Stunning Interactive Maps with Python and Folium in Minutes](https://towardsdatascience.com/how-to-make-stunning-interactive-maps-with-python-and-folium-in-minutes-e3aff3b0ed43/)\n[Programming](https://towardsdatascience.com/category/programming/)\nVisualizing earthquake data was never simpler\n[Dario Radečić](https://towardsdatascience.com/author/radecicdario/)\nDecember 11, 20204 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/08/0h5SvI0pSUIGuD_C5-scaled.jpg)](https://towardsdatascience.com/how-to-work-with-censored-data-26b7b6e2c7f/)\n## [How to work with censored data](https://towardsdatascience.com/how-to-work-with-censored-data-26b7b6e2c7f/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nAn application of the Tobit model to the gig economy\n[Alvaro Corrales Cano](https://towardsdatascience.com/author/acorralescano/)\nAugust 24, 20229 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/07/1GjJSiAZnLk4rflrDSTYRlQ.gif)](https://towardsdatascience.com/how-to-create-maps-in-plotly-with-non-us-locations-ca974c3bc997/)\n## [How to create maps in Plotly with non-US locations](https://towardsdatascience.com/how-to-create-maps-in-plotly-with-non-us-locations-ca974c3bc997/)\n[Programming](https://towardsdatascience.com/category/programming/)\nPeople in the US will never know our pain.\n[Kerry Halupka](https://towardsdatascience.com/author/kerry.halupka/)\nJuly 28, 20204 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/10/0hxdJhKXBEYY_v0WR-scaled.jpg)](https://towardsdatascience.com/statistics-supporting-linear-models-bfc24fb9781f/)\n## [Improve Linear Regression Using Statistics](https://towardsdatascience.com/statistics-supporting-linear-models-bfc24fb9781f/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nA detailed post about the mathematical foundations of linear regression and how to use it to improve the goodness of fit.\n[Sandeep Ram](https://towardsdatascience.com/author/sandeepram3103/)\nOctober 14, 20202 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/05/0YovO007JdY4G5qjH.png)](https://towardsdatascience.com/fcds-b2d2e6b08d34/)\n## [Full Cycle Data Science (FCDS)](https://towardsdatascience.com/fcds-b2d2e6b08d34/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nKey to Scaling Data-Driven Organizations\n[Daniel Marcous](https://towardsdatascience.com/author/dmarcous/)\nMay 22, 202123 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/10/05AHYCyDXDXroNnOC-scaled.jpg)](https://towardsdatascience.com/summarizing-different-types-of-statistical-univariate-tests-801c7e8921c7/)\n## [Summarizing Different Types of Statistical Univariate Tests](https://towardsdatascience.com/summarizing-different-types-of-statistical-univariate-tests-801c7e8921c7/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nA summary of choosing suitable statistical univariate tests to make data inferences\n[Chi Nguyen](https://towardsdatascience.com/author/nphchi223/)\nOctober 5, 20226 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607631/image?etag=1781543525510&width=500&height=500) Critical Mistakes Companies Make When Integrating AI/ML into Their Processes ](https://towardsdatascience.com/critical-mistakes-companies-make-when-integrating-ai-ml-into-their-processes/ \"Critical Mistakes Companies Make When Integrating AI/ML into Their Processes\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500) How Relevance Models Foreshadowed Transformers for NLP ](https://towardsdatascience.com/how-relevance-models-foreshadowed-transformers-for-nlp/ \"How Relevance Models Foreshadowed Transformers for NLP\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n\n\n",
  "metadata": {
    "title": "Python QuickStart for People Learning AI | Towards Data Science",
    "description": "A beginner-friendly guide",
    "keywords": null,
    "author": "Shaw Talebi",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "Python QuickStart for People Learning AI",
    "og:description": "A beginner-friendly guide",
    "og:url": "https://towardsdatascience.com/python-quickstart-for-people-learning-ai-58a1b76df0f4/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2024/09/1-mbIMdku5V3kilFWTRHuLQ.png",
    "og:image:width": "1280",
    "og:image:height": "720",
    "og:image:type": "image/png",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Shaw Talebi",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "13 min read",
    "article:published_time": "2024-09-08T15:54:36.000Z",
    "article:modified_time": "2024-09-08T15:54:36.000Z",
    "article:author": "https://towardsdatascience.com/author/shawhin/"
  },
  "paywall": {
    "listed_paid": true,
    "detected": false,
    "marker": "",
    "public_only": true,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_000.txt",
      "chars": 40
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_001.txt",
      "chars": 82
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_002.txt",
      "chars": 74
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_003.txt",
      "chars": 77
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_004.txt",
      "chars": 159
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_005.txt",
      "chars": 63
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_006.txt",
      "chars": 169
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_007.txt",
      "chars": 464
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_008.txt",
      "chars": 84
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_009.txt",
      "chars": 287
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_010.txt",
      "chars": 50
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_011.txt",
      "chars": 20
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_012.txt",
      "chars": 495
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_013.txt",
      "chars": 257
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_014.txt",
      "chars": 391
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_015.txt",
      "chars": 398
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_016.txt",
      "chars": 350
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_017.txt",
      "chars": 371
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_018.txt",
      "chars": 309
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_019.txt",
      "chars": 515
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_020.txt",
      "chars": 528
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_021.txt",
      "chars": 18
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_022.txt",
      "chars": 210
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_023.txt",
      "chars": 22
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_024.txt",
      "chars": 77
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_025.txt",
      "chars": 18
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_026.txt",
      "chars": 32
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_027.txt",
      "chars": 48
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_028.txt",
      "chars": 74
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_029.txt",
      "chars": 883
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_030.txt",
      "chars": 681
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_031.txt",
      "chars": 381
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_032.txt",
      "chars": 64
    },
    {
      "language": "txt",
      "file": "attachments/e8ede08d0dbe/code/block_033.txt",
      "chars": 755
    }
  ],
  "images": [
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2024/09/1-mbIMdku5V3kilFWTRHuLQ.png",
      "alt": "Image from Canva.",
      "local_path": "attachments/e8ede08d0dbe/images/000.png",
      "bytes": 357266,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2024/09/1WLRwkH-uTeg1b2ndgVFERQ.png",
      "alt": "Using Python in Terminal. Image by author.",
      "local_path": "attachments/e8ede08d0dbe/images/001.png",
      "bytes": 14439,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2024/09/1j-6e7IPbjeLiN9kd52n-0Q.png",
      "alt": "A non-comprehensive overview of Python libs for data science and AI. Image by author.",
      "local_path": "attachments/e8ede08d0dbe/images/002.png",
      "bytes": 117651,
      "downloaded": true
    },
    {
      "src": "/images/fallback-image.jpg",
      "alt": "",
      "local_path": "",
      "bytes": 0,
      "downloaded": false
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2025/12/lakehpuse.jpg",
      "alt": "",
      "local_path": "attachments/e8ede08d0dbe/images/004.jpg",
      "bytes": 101728,
      "downloaded": true
    },
    {
      "src": "/images/fallback-image.jpg",
      "alt": "",
      "local_path": "",
      "bytes": 0,
      "downloaded": false
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/1rv9kadG6E2Mgx3Os4kQNfQ-scaled.jpeg",
      "alt": "",
      "local_path": "attachments/e8ede08d0dbe/images/006.jpeg",
      "bytes": 395788,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2022/08/0h5SvI0pSUIGuD_C5-scaled.jpg",
      "alt": "",
      "local_path": "attachments/e8ede08d0dbe/images/007.jpg",
      "bytes": 676943,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/07/1GjJSiAZnLk4rflrDSTYRlQ.gif",
      "alt": "",
      "local_path": "attachments/e8ede08d0dbe/images/008.gif",
      "bytes": 4504041,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/10/0hxdJhKXBEYY_v0WR-scaled.jpg",
      "alt": "",
      "local_path": "attachments/e8ede08d0dbe/images/009.jpg",
      "bytes": 275504,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/05/0YovO007JdY4G5qjH.png",
      "alt": "",
      "local_path": "attachments/e8ede08d0dbe/images/010.png",
      "bytes": 90126,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2022/10/05AHYCyDXDXroNnOC-scaled.jpg",
      "alt": "",
      "local_path": "attachments/e8ede08d0dbe/images/011.jpg",
      "bytes": 326486,
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [
    {
      "src": "https://www.youtube.com/c/TowardsDataScience",
      "quality": "unavailable",
      "local_path": "",
      "note": "无1080p且无720p，未交付更低清晰度"
    }
  ],
  "links": [
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/editors-pick/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/the-variable/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/shipai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/submissions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/shawhin/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/cracking-open-the-openai-python-api-230e4cae7971"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/ai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/llm/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/python/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/python-programming/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/interested-in-decision-intelligence-start-here-30ed4fec81fa/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/ludobenistant/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/bootstrap-a-data-lakehouse-in-an-afternoon/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/data-science/data-engineering/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/thomas_reid/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest-picks-how-to-structure-your-data-science-workflow-1d1622a2e8ad/"
    },
    {
      "type": "external",
      "href": "https://write.insightmediagroup.io"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/company/towards-data-science/"
    },
    {
      "type": "external",
      "href": "https://x.com/TDataScience"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-data-scientist"
    },
    {
      "type": "external",
      "href": "https://docs.python.org/3/using/windows.html"
    },
    {
      "type": "external",
      "href": "https://docs.python.org/3/using/mac.html"
    },
    {
      "type": "external",
      "href": "https://www.anaconda.com/download/success"
    },
    {
      "type": "external",
      "href": "https://github.com/ShawhinT/YouTube-Blog/tree/main/python-quickstart"
    },
    {
      "type": "external",
      "href": "https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf"
    },
    {
      "type": "external",
      "href": "https://jupyter.org/"
    },
    {
      "type": "external",
      "href": "https://www.shawhintalebi.com/"
    },
    {
      "type": "external",
      "href": "https://www.deeplearning.ai/short-courses/ai-python-for-beginners/"
    },
    {
      "type": "external",
      "href": "https://www.facebook.com/sharer/sharer.php?title=Python+QuickStart+for+People+Learning+AI&u=https%3A%2F%2Ftowardsdatascience.com%2Fpython-quickstart-for-people-learning-ai-58a1b76df0f4%2F"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/shareArticle?mini=true&title=Python+QuickStart+for+People+Learning+AI&url=https%3A%2F%2Ftowardsdatascience.com%2Fpython-quickstart-for-people-learning-ai-58a1b76df0f4%2F"
    },
    {
      "type": "external",
      "href": "https://x.com/share?text=Python+QuickStart+for+People+Learning+AI&url=https%3A%2F%2Ftowardsdatascience.com%2Fpython-quickstart-for-people-learning-ai-58a1b76df0f4%2F"
    },
    {
      "type": "external",
      "href": "https://www.youtube.com/c/TowardsDataScience"
    },
    {
      "type": "external",
      "href": "https://www.threads.net/@towardsdatascience"
    },
    {
      "type": "external",
      "href": "https://bsky.app/profile/towardsdatascience.com"
    },
    {
      "type": "external",
      "href": "https://thenewstack.io"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T11:11:49Z",
  "source_url": "https://towardsdatascience.com/python-quickstart-for-people-learning-ai-58a1b76df0f4/",
  "delivery_status": "excluded_paid",
  "discovery_status": "excluded_paid",
  "missing_reason": "按原约定排除付费/会员全文"
}