data science test

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

26 Terms

1
New cards

Which chart is generally best for comparing values across categories?

Bar chart

2
New cards
3
New cards

Which of the following is a python variable

Student_scores

4
New cards

What does df["Total"] = df["Quiz"] + df["Exam"] do?

Creates a new Total column by adding the Quiz and Exam values in each row

5
New cards

Which Pandas indexer selects rows and columns by their labels rather than by position?

.loc

6
New cards

Which widely used Python library is highly flexible for creating many kinds of plots and charts?

Matplotlib

7
New cards

What does tail() usually return for a Pandas DataFrame?

The last few rows

8
New cards

What does print(df.iloc[2]) print?

The row for index 2 (StudentID S3, Score 75)

9
New cards

What does the input function returns when the user types it?

String (str) data type

10
New cards

Which Python library provides data structures and functions for efficient tabular data?

Pandas

11
New cards

Prediction in data science mainly means what?

Using known information to estimate unknown values

12
New cards

What does plt.scatter(study_hours, exam_scores) create?

A scatter plot showing the relationship between study hours and exam scores

13
New cards

Which Pandas method provides quick statistical information about the DataFrame?

.describe()

14
New cards

An elif statement is the required first conditional statement in every Python program.

False

15
New cards

random.randint(a, b) can return both endpoint values a and b.

True

16
New cards

In Python, the indentation and punctuation of a program are optional.

False

17
New cards

Outside a string literal, a hash symbol (#) begins a comment; Python ignores the text after it on that line.

True

18
New cards

A loop that never reaches a terminating condition can run indefinitely in a Jupyter Notebook.

True

19
New cards

Using too many colors can make a chart harder to read.

True

20
New cards

pd.read_csv() is a common method for loading CSV data into a DataFrame.

True

21
New cards

Pandas is widely used in fields that work with tabular or structured data.

True

22
New cards

Real-world data is always complete and error-free.

False

23
New cards

NumPy is a high-level, user-friendly interface whose main purpose is creating plots.

False

24
New cards

Find the errors and rewrite the code as a complete working program: score = input("enter your score: ") if score >= 70: print("Passed")

Two errors: input() returns a string (must use int()), and the print statement is not indented. Corrected code: score = int(input("Enter your score: "))\nif score >= 70:\n print("Passed")

25
New cards

Define a Pandas DataFrame. Then explain how the head() and tail() methods can be used to view its data.

A Pandas DataFrame is a labeled table with rows and columns.

head() shows the first few rows so you can preview the start of the data.

tail() shows the last few rows so you can check the end of the data.

26
New cards

Assume the user enters 7. What is the complete output of the code? Explain how the loop changes x and why it stops.

The loop starts at 7. It prints the number, then subtracts 2 each time. It stops when x becomes less than or equal to 0.