
Python for Data Analysis
Practise the Python data workflow: load files, inspect DataFrames, clean messy columns, group and join data, handle dates, use NumPy, plot results, and debug common mistakes.
Recommended next
156 questions ready
Start with a quiz
Answer from memory first, then review the rationales and revisit weak areas from this course.
Activities
Quiz156 Questions
Flashcards161 Cards
Study Notes12 Notes
Mind Map4 Maps
List of Questions30 questions
- Question 1
- Performs standard division and returns a float
- Calculates the remainder of a division
- Performs floor division and returns an integer result
- Raises a number to a power
- Question 2
- my_list = [1, 2, 3]
- my_list = (1, 2, 3)
- my_list = {1, 2, 3}
- my_list = <1, 2, 3>
- Question 3
- IndexError: string index out of range
- 'P'
- 'n'
- 'o'
- Question 4
- It returns
None - It raises a
NameError - It raises a
SyntaxError - It automatically creates a new variable with a value of
0
- It returns
- Question 5
- x == 5
- x := 5
- x -> 5
- x = 5
- Question 6
- The number of elements in the list
- The data type of the list
- The memory size of the list in bytes
- The index of the last element
- Question 7
- func my_func():
- define my_func():
- def my_func():
- function my_func():
- Question 8
- Tuples can only contain numbers
- Lists cannot be indexed
- Lists are mutable, tuples are immutable
- Lists are immutable, tuples are mutable
- Question 9
- [0, 1, 2, 3, 4]
- [5, 6, 7, 8, 9, 10]
- An error because
rangerequires a single argument - [5, 6, 7, 8, 9]
- Question 10
- 2
- KeyError
- 4
- 3
- Question 11
{'Alice': 10, 'Bob': 8, 'Charlie': 7}{'Alice': 10, 'Bob': 5, 'Charlie': 7}Error: dictionary changed size during iteration{'Alice': 10, 'Bob': 8}
- Question 12
- France
- None
- KeyError
- True
- Question 13
- 150
- 120
- 90
- 60
- Question 14
- 5
- 3
- 7
- 2
- Question 15
- 4
- KeyError
- 3
- 2
- Question 16
- Installs the pandas library
- Reads a CSV file into a pandas DataFrame
- Creates a new pandas DataFrame
- Imports the pandas library and gives it the alias
pd
- Question 17
- pd.open_csv()
- pd.load_csv()
- pd.read_csv()
- pd.import_csv()
- Question 18
- df.tail(8)
- df.head(8)
- df.top(8)
- df.first(8)
- Question 19
- df.details()
- df.summary()
- df.info()
- df.describe()
- Question 20
- A list of all unique values in the DataFrame
- The data type of each column in the DataFrame
- The number of rows in the DataFrame
- The shape of the DataFrame as a tuple
- Question 21
- df.export_excel()
- df.save_excel()
- df.to_excel()
- df.write_excel()
- Question 22
- To measure the memory usage of the DataFrame
- To delete the last few rows of the DataFrame
- To display the first
nrows of a DataFrame for inspection - To calculate summary statistics for all numeric columns
- Question 23
- int64
- bool
- object
- float64
- Question 24
df.columnsdf.dtypesdf.indexdf.shape
- Question 25
missing_values='N/A'na_values='N/A'fillna='N/A'null_values='N/A'
- Question 26
- Those columns contain missing values.
- The data types of those columns are incorrect.
- The DataFrame has duplicate rows.
- The CSV file had inconsistent delimiters in those columns.
- Question 27
df.info()df.sample(5)df.describe()df.dtypes
- Question 28
- The index is saved as a separate column without a header.
- The index is saved as a separate column with a header.
- The index is saved as the first row of the file.
- The index is not saved.
- Question 29
- A random sample of three rows from the end of the DataFrame.
- The first three rows of the DataFrame.
- The last three rows of the DataFrame.
- The last three columns of the DataFrame.
- Question 30
skiprows=1header=Noneno_header=Truenames=False
List of Flashcards161 flashcards
Flashcards will appear here once they are ready.