1. Home
  2. Explore
  3. Computer Science
  4. Data Science Basics with Python

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Data Science Basics with Python

  • 53Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Setup and Python Basics
The tool that makes setting up a data science environment easier by packaging necessary libraries is called
.

53 questions

  1. 1
    The tool that makes setting up a data science environment easier by packaging necessary libraries is called
    _____
    .
    Hint

    Think of a distribution that bundles Python and data science packages together.

    Answer

    Anaconda

  2. 2
    In Visual Studio Code, you can install the
    _____
    extension to get Jupyter notebook support along with intellisense and linting.
    Hint

    The extension that provides rich support for the Python language in VS Code.

    Answer

    Python

  3. 3
    To annotate a Jupyter notebook with explanatory text, you use
    _____
    cells.
    Hint

    This type of cell allows you to write formatted text, not code.

    Answer

    markdown

  4. 4
    In Python, a list is created using square brackets, and you can see its contents by using the
    _____
    function.
    Hint

    This built-in function outputs text or variables to the console.

    Answer

    print

  5. 5
    The Variable Explorer in VS Code shows the
    _____
    of a list or other objects in the current Python session.
    Hint

    It reveals the individual elements stored inside the variable.

    Answer

    items

  6. 6
    Unlike a list, multiplying a numpy array by a number performs
    _____
    arithmetic on each element.
    Hint

    Think of an operation that applies to each individual component separately.

    Answer

    element-wise

  7. 7
    To find the number of elements in a numpy array, you use the
    _____
    attribute.
    Hint

    This attribute returns a tuple representing the dimensions of the array.

    Answer

    shape

  8. 8
    In Python, array indices start at
    _____
    , so the first element is accessed with index 0.
    Hint

    The starting number for counting positions in a sequence.

    Answer

    0

  9. 9
    To compute the average of a numpy array, you use the
    _____
    method.
    Hint

    A common statistical measure for central tendency.

    Answer

    mean

  10. 10
    A 2D numpy array can be created by passing a list of lists to the
    _____
    function.
    Hint

    This function converts a Python list into a numpy array.

    Answer

    np.array

  11. 11
    To access the first item from the second array inside a 2D numpy array, you use indexing like
    _____
    .
    Hint

    Remember that indexing starts at 0, and the first index selects the row (sub-array), the second selects the element.

    Answer

    [1, 0]

  12. 12
    A pandas DataFrame is a tabular data structure that can be thought of as a
    _____
    .
    Hint

    It resembles a spreadsheet with rows and columns.

    Answer

    table

  13. 13
    To create a pandas DataFrame from a dictionary of arrays, you use the
    _____
    constructor.
    Hint

    The pandas library's primary data structure constructor.

    Answer

    pd.DataFrame

  14. 14
    To access a row by its integer position in a DataFrame, you use the
    _____
    method.
    Hint

    This method is label-based, but when using integer indices, it works for label-based access if the index is integer.

    Answer

    loc

  15. 15
    To get a specific column from a row using .loc, you pass the row label and the
    _____
    name as the second argument.
    Hint

    The vertical dimension in a DataFrame, which has a name.

    Answer

    column

  16. 16
    To filter rows in a DataFrame where a column equals a value, you use a boolean expression like df[
    _____
    ].
    Hint

    This creates a boolean mask that selects rows where the condition is True.

    Answer

    df['name'] == 'Vicky'

  17. 17
    The DataFrame method that allows querying using a string expression is called
    _____
    .
    Hint

    This method accepts a query string similar to SQL.

    Answer

    query

  18. 18
    You can access a DataFrame column directly as an attribute if the column name is a valid Python identifier, like
    _____
    .
    Hint

    This uses dot notation to select a column.

    Answer

    df.grade

  19. 19
    To load a CSV file into a pandas DataFrame, you use the
    _____
    function.
    Hint

    This function reads comma-separated values into a DataFrame.

    Answer

    pd.read_csv

  20. 20
    The method .isnull() returns a DataFrame of the same shape with True where values are
    _____
    .
    Hint

    This indicates absent or not-a-number values.

    Answer

    missing

  21. 21
    To replace missing values with the mean of a column, you use the
    _____
    method.
    Hint

    This method fills in null entries with a specified value.

    Answer

    fillna

  22. 22
    To remove rows with any missing values, you use the
    _____
    method with axis=0.
    Hint

    This method drops rows (or columns) that contain null values.

    Answer

    dropna

  23. 23
    To add a new column to a DataFrame, you can use pd.concat with axis=
    _____
    , which concatenates along the column axis.
    Hint

    Axis 0 is for rows, axis 1 is for columns.

    Answer

    1

  24. 24
    The DataFrame method to group rows by a column and then compute aggregate statistics is
    _____
    .
    Hint

    This allows split-apply-combine operations.

    Answer

    groupby

  25. 25
    To sort a DataFrame by a column in ascending order, you use the
    _____
    method.
    Hint

    This method reorders rows based on column values.

    Answer

    sort_values

  26. 26
    To sort a DataFrame in descending order, set the parameter ascending to
    _____
    .
    Hint

    This boolean parameter controls the direction of sorting.

    Answer

    False

  27. 27
    The library commonly used for plotting in Python is
    _____
    .
    Hint

    This library provides a MATLAB-like plotting interface.

    Answer

    matplotlib

  28. 28
    To create a bar chart in matplotlib, you use the
    _____
    function.
    Hint

    This function draws vertical or horizontal bars.

    Answer

    bar

  29. 29
    To rotate x-axis labels in a matplotlib plot, you use the
    _____
    parameter in xticks.
    Hint

    This parameter takes an angle in degrees.

    Answer

    rotation

  30. 30
    In matplotlib, the entire window including the plot is called a
    _____
    .
    Hint

    This is the top-level container for all plot elements.

    Answer

    figure

  31. 31
    To set the size of a figure, you use the
    _____
    parameter in plt.figure() or when creating subplots.
    Hint

    This parameter takes a tuple (width, height) in inches.

    Answer

    figsize

  32. 32
    A figure containing multiple plots is created using the
    _____
    method.
    Hint

    This returns a figure and an array of axes.

    Answer

    subplots

  33. 33
    To create a pie chart from a pandas Series, you use the
    _____
    method on the axis.
    Hint

    This function draws a circular statistical graphic.

    Answer

    pie

  34. 34
    To create a histogram showing the distribution of data, you use the
    _____
    method.
    Hint

    This plot groups data into bins.

    Answer

    hist

  35. 35
    To add a vertical line to a plot at a specific x-value, you use the
    _____
    method.
    Hint

    This draws a vertical line across the axes.

    Answer

    axvline

  36. 36
    A box plot displays the distribution of data based on five-number summary: minimum, first quartile, median, third quartile, and
    _____
    .
    Hint

    This is the highest value in the data, excluding outliers.

    Answer

    maximum

  37. 37
    To create a scatter plot in matplotlib, you use the
    _____
    function.
    Hint

    This shows points without connecting lines.

    Answer

    scatter

  38. 38
    The value that occurs most frequently in a dataset is called the
    _____
    .
    Hint

    This is another measure of central tendency besides mean and median.

    Answer

    mode

  39. 39
    The middle value when data is sorted from lowest to highest is the
    _____
    .
    Hint

    This measure is resistant to outliers.

    Answer

    median

  40. 40
    The difference between the maximum and minimum values in a dataset is called the
    _____
    .
    Hint

    A simple measure of spread.

    Answer

    range

  41. 41
    The average of the squared differences from the mean is called the
    _____
    .
    Hint

    It measures how far the data points are spread out.

    Answer

    variance

  42. 42
    The square root of the variance is the
    _____
    .
    Hint

    This measure is in the same units as the data.

    Answer

    standard deviation

  43. 43
    In a normal distribution, approximately
    _____
    % of the data falls within one standard deviation of the mean.
    Hint

    This is the 'magic number' for the empirical rule.

    Answer

    68

  44. 44
    The .describe() method on a DataFrame returns summary statistics including mean, std, min, max, and
    _____
    .
    Hint

    These are the 25th, 50th, and 75th percentiles.

    Answer

    quartiles

  45. 45
    A correlation value close to 1 indicates a strong
    _____
    correlation between two variables.
    Hint

    As one variable increases, the other tends to increase.

    Answer

    positive

  46. 46
    The phrase 'correlation does not imply
    _____
    ' warns against assuming a direct cause-and-effect relationship.
    Hint

    A relationship does not necessarily mean one causes the other.

    Answer

    causation

  47. 47
    To normalize features to a range between 0 and 1, you can use the
    _____
    scaler from scikit-learn.
    Hint

    This scaler transforms features by scaling each to a given range.

    Answer

    MinMaxScaler

  48. 48
    In linear regression, the equation of the line is y =
    _____
    x + b.
    Hint

    This letter represents the slope of the line.

    Answer

    m

  49. 49
    The method of finding the line of best fit by minimizing the sum of squared errors is called
    _____
    regression.
    Hint

    This is the most common method for linear regression.

    Answer

    ordinary least squares

  50. 50
    To compute the slope and intercept of a linear regression in Python, you can use the
    _____
    function from scipy.stats.
    Hint

    This function returns slope, intercept, r-value, p-value, and standard error.

    Answer

    linregress

  51. 51
    The difference between the actual y value and the predicted y value (from the regression line) is called the
    _____
    .
    Hint

    Also known as the residual.

    Answer

    error

  52. 52
    Using the slope and intercept from linear regression, you can predict a new y value by computing
    _____
    .
    Hint

    This is the equation of the line of best fit.

    Answer

    m * x + b

  53. 53
    To create a scatter plot with a regression line, you first plot the scatter data and then use the
    _____
    function to plot the line.
    Hint

    This function draws a line through the predicted y values.

    Answer

    plot

1 of 53
Question 1 of 53

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent