O'Reilly logo

Practical Time Series Analysis by Dr. PKS Prakash, Dr. Avishek Pal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Keywords and functions

Keywords are reserved words that cannot be used as variable names. The following table gives the list of keywords and their purpose:

Keywords

Explanation

False

Boolean false value:

>>bool_var = False

True

Boolean true value:

>>bool_var = True

and

Logical operator that returns True only if both the operands are True or evaluates to True:

>>a = 2

>>if a > 0:

print(a)

>>2

as

Creates an alias for a module that is being imported:

import pandas as pd

import scikit-learn as skl

assert

Used to evaluate a logical expression to check values of variables at runtime and raises an AssertionError if the expression evaluates to False:

>>a = -2

>> assert a > 0

The preceding assert keyword raises ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required