Python Numpy Totorial Flashcards

1
Q

What is Jupyter notebook used for?

A

A Jupyter notebook lets you write and execute Python code locally in your web browser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Colab used for?

A

Colab on the other hand is Google’s flavor of Jupyter notebooks that is particularly suited for machine learning and data analysis and that runs entirely in the cloud.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Python ?

A

Python is a high-level, dynamically typed multiparadigm programming language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why Python ?

A

Python code is often said to be almost like pseudocode, since it allows you to express very powerful ideas in very few lines of code while being very readable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Python implements all of the usual operators for Boolean logic, but uses English words rather than symbols

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Python includes several built-in container types:

A

lists, dictionaries, sets, and tuples.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a list?

A

A list is the Python equivalent of an array, but is resizeable and can contain elements of different types:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is slicing?

A

In addition to accessing list elements one at a time, Python provides concise syntax to access sublists; this is known as slicing:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a dictionary ?

A

A dictionary stores (key, value) pairs, similar to a Map in Java or an object in Javascript. You can use it like this:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a set?

A

A set is an unordered collection of distinct elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a tuple?

A

A tuple is an (immutable) ordered list of values. A tuple is in many ways similar to a list; one of the most important differences is that tuples can be used as keys in dictionaries and as elements of sets, while lists cannot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How are Python functions defined?

A

Using the def keyword.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How are Python classes defined?

A

The syntax for defining classes in Python is class:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Numpy?

A

Numpy is the core library for scientific computing in Python. It provides a high-performance multidimensional array object, and tools for working with these arrays.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Numpy array?

A

A numpy array is a grid of values, all of the same type, and is indexed by a tuple of nonnegative integers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Rank of the array, and shape of an array?

A

The number of dimensions is the rank of the array; the shape of an array is a tuple of integers giving the size of the array along each dimension.

17
Q

Slicing numpy arrays:

A

Slicing: Similar to Python lists, numpy arrays can be sliced. Since arrays may be multidimensional, you must specify a slice for each dimension of the array:

18
Q

What is broadcasting?

A

Broadcasting is a powerful mechanism that allows numpy to work with arrays of different shapes when performing arithmetic operations. Frequently we have a smaller array and a larger array, and we want to use the smaller array multiple times to perform some operation on the larger array.