lecture2_Python1
lecture2_Python1
1. Introduction
programming machine
language language 1010110 …
compiler
stores code and data Data and code are allocated processes instructions
object-oriented language
C++ C A A A 1983
(main language for finance)
garbage collector
JAVA B B A C 1991
(developers' main language)
high-productivity and
Python A C A A 1989
general-purpose language
specialization in
MATLAB A C C B 1984
math/engineering
3 C++ 9.76%
16 MATLAB 1.11%
『Apr 2024』
Countdown to the end of life of Python 2 that dominates the AI ecosystem GDNet Korea 2020.1.20
Julia vs Python... What is the best data language? CIO Korea 2019.7.12
Python is the most preferred programming language for engineers. GDNet Korea 2019.9.9
Unbelievable growth, about the innovation that Python will lead in the future CIO Korea 2019.5.18
Math and Python data analysis you must know IT news 2019.12.27
Python's popularity is at an all-time high... Overtake Java and C in 3 or 4 years CIO Korea 2019.6.10
bottleneck
C++
Monty Python
* compiled language *
*translation*
for j in range(0,2) :
do *order*
*order*
Computer memory is broadly divided into heap and stack. By default, data and code are
allocated on the stack, but data that requires a lot of memory are allocated on the heap.
Memory allocated on the heap must be returned for the next operation when the variable is no
longer needed. Languages such as C and C++ require the user to perform this series of
processes themselves. In languages such as Python and Java, the garbage collector performs
memory management on behalf of the user.
b
allocate/
release
c memory o
a
r
programmer garbage collector
space for variables that require a lot of memory
In static type languages such as C, C++, Java, when declaring a variable, the data type must be
written as shown below.
However, in a dynamic type language like Python, there is no need to specify the data type.
* type error
a=c
static type: An error occurred because an attempt was made to assign a string to an integer variable.
dynamic type: The variable a is automatically converted from an integer variable to a string variable.
a+c
static type: An error occurred because an attempt was made to add a string to an integer variable.
dynamic type: Same as for static type.
Dynamic type languages are convenient because you don't have to worry about the types of
variables, but always be aware that bugs can occur due to type errors!
statsmodels
Machine Learning Linear algebra library
scikit-learn (Deep Learning x) library
numpy
Google's deep
tensorflow learning library Numerical analysis library
scipy
▪ After installing only Python, packages are each installed using pip.
▪ Python 2 is supported until 2020. You must use Python 3.
▪ Most computers are 64-bit systems
(32-bit and 64-bit refer to the amount of space for memory addresses)
▪ So, if you are not using Mac or Linux, you can download the 64-bit Windows
version of Python 3.
anaconda.com
② click
Or click
save file
• pip list
checks the list of packages installed on the system