Introduction to Python

Session Overview

  • Launching Python
  • Versions
  • Python as a Calculator
  • Variable Assignment
  • Beginning data structures

Let’s Play!

  • Log Into Course Platform https://esds.ncics.org/

  • Select previous Workspace and turn it on.

  • Select Terminal when it is on…

Why Python for Data Science?

  • Scripted Language
  • Robust support for data science applications
  • Extensive scientific computing libraries (NumPy, Pandas, SciPy)
  • Rich ecosystem of cloud computing tools
  • Clear, readable syntax perfect for scientific workflows
  • Huge community support and documentation
  • Current standard for Deep Learning and LLM development/deployment

Python in the Cloud

  • Native support in all cloud platforms (AWS, Google Cloud, Azure)
  • Excellent for working with cloud storage (S3, Google Cloud Storage)
  • Great tools for parallel processing of big data
  • Seamless integration with cloud databases and APIs
  • Natively integrates with containerization and deployment

Launching Python

  • Run python3 on the command line.

  • What version are you running?

  • What is your prompt?

Calculations

  • Try addition, subtraction, division, and multiplication

What is the difference between 2.0 + 1.0 and 2+1?


What about 10/2?

Variable Assignment

Variables are stored using the = in python.


a = 2
b = 3
c = 1.0

a + b + c

Variable Assignment

a = "Hello"
b = "World"

a 
b 

a + b


a + b + c

Beginning Data Structures

What are Data Types?

Beginning Data Structures

What are Data Types?


How data are stored in memory:

  • Integers: int
  • Floats: float, complex
  • Strings (Text): str
  • Boolean: bool

Beginning Data Structures

a = "Hello"
type(a)

b = 2
type(b)

c = 2 + 1j
type(c)

d = True
e = False
type(d)
type(e)

Beginning Data Structures

a = 10
b = 2
c = a/b

type(a)
type(b)
type(c)

Beginning Data Structures

a = 2.0

b = str(a)
b

type(a)
type(b)


a = "2.0"

b = int(a)
b = float(a)

type(a)
type(b)

c = int(b)
type(c)

Beginning Data Structures

Make 24 from dividing two large numbers.


When done:

quit()