Intro to Python

Cards (252)

  • Python is an interpreted programming language that is widely used for learning, general purposes, and data science
  • Programming language
    A language used to write instructions that a computer can execute
  • Both Kyle and Morgan realize that their application could help many soccer players worldwide and selling it to them could help their bank accounts
  • To maximize the distribution of the application, it must work on a variety of platforms seamlessly
  • The software will heavily rely on statistical computing power, using a lot of data and complex mathematics
  • Software development
    The process of conceptualizing, designing, programming, and testing to create software applications or components
  • Syntax
    The rules and symbols used to create programs in a programming language
  • Interpreted Language
    Python is called an interpreted language because code written in Python can be executed directly without needing to be precompiled into machine language instructions
  • Data Science
    A field that uses a scientific approach to the organization, representation, and analysis of data through algorithms and computation
  • Python is a great program for learning software development, particularly if you have never programmed before
  • Python surpassed Java as the language most used in introductory computer science courses in United States universities in 2014
  • As of August 2019, Python was ranked first on the PYPL Popularity of Programming Languages Index, ahead of Java, JavaScript, and C#
  • Python has consistently risen in the TIOBE Programming Community Index since its inception, jumping from fourth place to third in September of 2018, behind only Java and C
  • Reasons why people love using Python
    • Python is free, and a variety of supporting tools, modules, and libraries are available at no cost to aspiring developers
    • Python's syntax is concise compared to that of many other languages, which means that you can do more with less, reducing the demand on the programmer
    • Python code is also easier to read than code written in many other languages because one of the central concepts in the creation of Python was that the code should resemble everyday English
    • Python has an active developer community that creates resources for entry-level and expert Python developers
    • Developers can use Python to build applications using procedural, object-oriented, or functional paradigms
    • Because Python is an interpreted language, developers can get immediate feedback without having to wait for an application to compile
  • Reasons why Python is a great choice for professional and scientific development
    • Despite being relatively easy to use and read, Python is extremely robust and powerful
    • Because Python is so easy to use and is such a concise language, it is a popular choice for quickly building working prototypes
    • Python is the language of choice for data science, and is heavily used when working with artificial intelligence
    • Because of its popularity in data science and AI, there is a huge ecosystem of libraries available for Python development in areas such as mathematics, statistics, machine learning, and deep learning
    • There are exceptional libraries and frameworks that facilitate web development in Python (Django and Flask are great examples)
    • Python is already extremely popular among educators, learners, and practitioners, and the trends show that this momentum is only increasing. That means that there are more jobs available with higher salaries to Python developers. Learning Python can help you pay the bills!
  • The Anaconda distribution of Python includes crucial tools such as NumPy, SciPy, and Pandas
  • For this class and throughout the data science program, we will be using Python version 3.x, not version 2.7
  • The traditional route is to create a "Hello, World" program as the first Python application
  • The Python interpreter reads the code, translates the code into something called "byte code," and then executes it in a Python Virtual Machine, returning the output to the user
  • Compiled languages
    Code is sent to a compiler, which translates the entire program into code that is compatible with the target or host machine. The target machine can then execute the code and return the output.
  • Interpreted languages
    Load an interpreter and return the output without creating executable machine code as an independent artifact.
  • How Python works
    1. Interpreter reads the code
    2. Translates the code into byte code
    3. Executes it in a Python Virtual Machine
    4. Returns the output to the user
  • Python commands
    • print("Hello, World!")
  • IPython
    • Extends the Python terminal into an interactive shell environment
    • Provides support for most Linux commands
    • Provides command history, auto-completion of python commands and many more features
  • Jupyter kernel
    A program that processes the requests from the notebook interface. The notebook and the kernel communicate via the ZeroMQ protocol.
  • Markdown
    A popular markup language with simple syntax for formatting plain text.
  • Creating a Jupyter Notebook
    1. Launch Jupyter Notebook
    2. Create a new Python 3 notebook
    3. Add Markdown and code cells
    4. Format text and execute code
  • Jupyter Notebook
    • Allows developers to combine rich-formatted text, inline code, mathematical formulas, plots and graphs, and other media into a single document
  • JupyterLab
    • Includes the Jupyter Notebook as well as other tools for Python development
    • Provides a terminal window, Python 3 console, and other options for working with Python
  • Software development is one of the most lucrative and rewarding careers available today
  • Python is the top programming language in the fields of data science and artificial intelligence
  • Python is an interpreted language, meaning that the Python interpreter reads code, executes it, and returns the output to the user
  • The Python community has created powerful and extremely efficient libraries for use in areas such as mathematics, statistics, data organization and manipulation, data visualization, machine learning, and deep learning
  • These tools and libraries make Python a top choice for data science development worldwide
  • Python is an interpreted language

    The Python interpreter reads code, executes it, and returns the output to the user
  • IPython
    Offers some advantages over the standard Python installation which can improve development
  • Jupyter Notebook and JupyterLab
    Evolved from IPython and, with IPython as the underlying interpreter, provide a rich development environment where Python developers can work with multiple files, combining code, Markup, and text along with terminal windows and other tools
  • On completion of this unit, you will have learned how to use variables in Python and how to assign them different values, how to work with various numerical data types, how to use string and character data types, how to store and work with collections of data, and how to perform basic file input/output operations
  • Variable
    A container that holds information
  • Hard-coding is a dangerous practice where a value is fixed and cannot be changed without editing the program itself