Data Type Constraints Flashcards

1
Q

When working with new data, what method you should use to check the data types of your columns?

A

.dtypes

.info()

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

What function computes a summary of statistics pertaining to the DataFrame columns?

A

.describe()

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

What is a pandas data type corresponding to categorical variables in statistics and takes on a limited, and usually fixed, number of possible values?

A

Category

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

What are some examples of Categorical variables?

A

Examples are gender, social class, blood type, country affiliation, observation time or rating via Likert scales.

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

What is categorical data?

A

might have an order (e.g. ‘strongly agree’ vs ‘agree’ or ‘first observation’ vs. ‘second observation’), but numerical operations (additions, divisions, …) are not possible

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

What method is used to cast a pandas object to a specified dtype? What function also provides the capability to convert any suitable existing column to a categorical type?

A

.astype()

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

What is a object that describes how the bytes in the fixed-size block of memory corresponding to an array item should be interpreted?

Type of the data (integer, float, Python object, etc.)

Size of the data (how many bytes is in e.g. the integer)

Byte order of the data (little-endian or big-endian)

A

.dtype()

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

What is used when debugging code? The keyword lets you test if a condition in your code returns True, if not, the program will raise an Error.

A

Assert Statement

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

What method removes characters from both left and right based on the argument (a string specifying the set of characters to be removed)?

A

.strip()

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