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

Study methods

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

Data Analysis with Python

  • 140Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Data Analysis
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is data analysis?

Tap to flipClick to flipspace

The process of inspecting, cleansing, transforming, and modeling data to discover useful information, draw conclusions, and support decision-making.

Or swipe the card

140 cards

  1. What is data analysis?

    The process of inspecting, cleansing, transforming, and modeling data to discover useful information, draw conclusions, and support decision-making.

  2. What are the main stages of a typical data analysis process?

    Acquire data, clean it, reshape or transform it, analyze it, and communicate findings through reports or other outputs.

  3. Why is data cleaning needed before analysis?

    Collected data may be incomplete, invalid, inconsistent, or poorly shaped; cleaning improves its suitability for analysis.

  4. What does transforming or reshaping data involve?

    Rearranging fields, reshaping tables, merging tables, or combining data from multiple sources to prepare it for analysis.

  5. What does modeling data mean in the tutorial's description of analysis?

    Representing real-life scenarios in information systems and using inferential statistics to look for patterns or models.

  6. How does data analysis turn data into information?

    It interprets data to identify meaningful findings, such as patterns or anomalies.

  7. Why must analysts communicate findings in reports or dashboards?

    To provide evidence of findings and make results understandable and useful for decision-making.

  8. Why is the data analysis process not strictly linear in practice?

    Analysts often move back and forth between stages, so the process behaves more like a cycle than a straight line.

  9. How do data analysts and data scientists tend to differ in emphasis?

    Data scientists typically emphasize programming, mathematics, machine learning, and ETL; analysts often emphasize communication, reporting, and storytelling.

  10. What are managed or closed data-analysis tools?

    Vendor-provided products that users can buy and use largely out of the box, such as Excel or Tableau.

  11. What are open or programming-based data-analysis tools?

    Programming languages combined with open-source libraries and other products, such as Python, R, and Julia.

  12. What is a key advantage and limitation of closed analysis tools?

    They are generally easier to learn and often have vendor support, but their capabilities are limited to the tool's scope.

  13. What are the main trade-offs of using a programming language for analysis?

    It offers flexibility and transferable skills, but takes more time to learn because users must first learn programming basics.

  14. Why can programming skills provide career flexibility for data analysts?

    Data-processing skills learned in a programming language can transfer across tools, organizations, and changing career needs.

  15. Why does the tutorial favor Python for data analysis?

    Python is described as readable and approachable, free and open source, supported by many libraries and an active community, and used by major institutions.

  16. How does the tutorial compare Python and R?

    Python is presented as easier to start with and more general in its libraries; R has a particularly large collection of statistical functions.

  17. Which libraries are highlighted for Python data analysis and visualization?

    Pandas for data analysis, and Matplotlib and Seaborn for visualization; NumPy is a foundational numerical library.

  18. Why can programming-based analysis scale better than visually inspecting spreadsheets?

    People cannot reliably inspect very large datasets by eye, and point-and-click processing can become slow as records grow; code works from data properties and computations instead.

  19. What is one portability benefit of programming-based analysis?

    Analysis processes can be moved between computers or to the cloud with relatively little overhead.

  20. What benefit of Python and SQL skills for analyst pay is mentioned in the tutorial?

    The tutorial reports that analysts who know Python and SQL are better paid than those who do not know programming tools.

  21. Why does a Python analyst use summaries instead of examining every row?

    Summaries reveal dataset structure and statistical properties without requiring visual inspection of every record.

  22. What does a pandas DataFrame's shape tell an analyst?

    The number of rows and columns in the DataFrame.

  23. What information does a pandas DataFrame info summary provide?

    Column names, data types, and counts of non-null values, among other structural details.

  24. What information does pandas describe provide for numeric columns?

    Summary statistics such as count, mean, standard deviation, minimum, maximum, and selected percentiles.

  25. How can comparing a mean and median help an analyst?

    Their relationship can provide a quick clue about a distribution's shape or possible skew.

  26. What does a box plot help reveal?

    The median, quartiles, spread, and potential outliers in a distribution.

  27. What does a value-counts summary show for a categorical variable?

    How many records fall into each category.

  28. What does a correlation matrix help an analyst investigate?

    The direction and strength of relationships between numeric variables.

  29. What can a scatter plot show about two variables?

    Whether their values appear related, including whether they show a roughly linear relationship.

  30. How can a derived column be created for further analysis?

    Apply a calculation to existing columns and assign the result as a new column.

  31. How can analysts check whether a supplied cost value is consistent with a recalculated cost?

    Compute a new cost from the relevant fields and compare it with the supplied cost column.

  32. What kinds of analysis outputs may follow data analysis?

    Reports and visualizations for communicating findings; in data-science work, machine-learning models may also be implemented.

  33. What is Jupyter?

    A free, open-source ecosystem of tools for interactive computing, including Jupyter Notebook and JupyterLab.

  34. How does JupyterLab differ from the classic Jupyter Notebook interface?

    JupyterLab provides a richer interface with features such as a file tree, terminals, previews, and other tools alongside notebooks.

  35. Why use a Jupyter Notebook for data analysis?

    It is an interactive environment where commands can be run and results inspected immediately.

  36. What is a Jupyter Notebook made up of?

    A sequence of cells.

  37. What are the main types of Jupyter Notebook cells?

    Code cells and Markdown cells; raw cells are also available.

  38. What is Markdown used for in a Jupyter Notebook?

    Writing formatted explanatory text, such as headings, links, quotes, and emphasized text.

  39. How can a notebook analysis be shared as a report?

    A notebook can be exported to formats such as PDF or HTML.

  40. What does a Jupyter cell's execution number indicate?

    The order in which code cells were executed, even if the cells have since been moved.

  41. What are Jupyter Notebook's two main interaction modes?

    Edit mode and command mode.

  42. How can you recognize and switch between Jupyter edit mode and command mode?

    In edit mode, typing changes cell contents; press Escape to enter command mode. In command mode, press Enter to edit the selected cell.

  43. In Jupyter command mode, what do A and B do?

    A inserts a cell above the selected cell; B inserts one below it.

  44. In Jupyter command mode, how do you delete a cell and undo an action?

    Press D twice quickly to delete the selected cell; press Z to undo an action.

  45. How do you change a Jupyter cell between Markdown and Python code using shortcuts?

    In command mode, press M for Markdown or Y for code.

  46. What is the difference between Ctrl+Enter and Shift+Enter in a Jupyter Notebook?

    Ctrl+Enter runs the current cell and keeps it selected; Shift+Enter runs it and moves selection to the next cell.

  47. What do the Jupyter command-mode shortcuts X, C, and V do?

    X cuts a cell, C copies it, and V pastes it.

  48. Why are visualizations convenient in Jupyter Notebooks?

    Plots from libraries such as Matplotlib can be displayed directly in notebook output.

  49. How do static Matplotlib plots differ from interactive Bokeh plots?

    Matplotlib plots are generally static images; Bokeh charts can support interactive actions such as zooming and panning.

  50. What is NumPy primarily designed to do?

    Efficient numerical computation, especially operations on arrays of numbers.

  51. Why can NumPy numerical operations be faster than pure Python loops?

    NumPy uses efficient low-level numerical implementations and array operations, including optimized CPU instructions.

  52. How does NumPy help control the memory used for numbers?

    Its numeric types can specify the bit width, such as an 888-bit or 646464-bit integer.

  53. Why can an ordinary Python integer use more memory than a NumPy integer?

    A Python integer is a high-level object with additional object overhead, while a NumPy integer uses a specified compact numeric representation.

  54. How many distinct values can be represented using nnn bits?

    2n2^n2n values.

  55. Why should integer types be chosen to fit the data's range?

    A type that is too wide wastes memory; a type must still be large enough to represent all valid values.

  56. How does NumPy store the elements of a numeric array?

    It stores same-typed elements in contiguous memory locations.

  57. How do you create a NumPy array from a Python list?

    Pass the list to numpy.array.

  58. How are basic indexing and slicing of a one-dimensional NumPy array similar to Python lists?

    They use zero-based positions, and support ordinary indexing, slices, negative indices, and steps.

  59. What is NumPy multi-indexing?

    Selecting several positions at once by passing a list or array of indices, producing a new NumPy array.

  60. Why does a NumPy array have a single data type?

    A uniform type lets NumPy store elements in a regular memory layout and optimize their processing.

  61. What do a NumPy array's shape, ndim, and size describe?

    shape gives the length along each dimension, ndim gives the number of dimensions, and size gives the total number of elements.

  62. How do you select an element from a two-dimensional NumPy array?

    Provide an index for each dimension, such as a row index and a column index.

  63. What do NumPy aggregate methods such as sum, mean, and std compute?

    They compute common summaries such as a total, mean, and standard deviation over array values.

  64. What is a vectorized operation in NumPy?

    An operation expressed on an array that is applied elementwise, such as adding a scalar to every element.

  65. What is broadcasting in NumPy?

    A mechanism that applies compatible operations across arrays or between an array and a scalar.

  66. Do ordinary NumPy arithmetic operations change the original array?

    Usually not; they return a new array. In-place operators such as += can modify the original.

  67. How can a Boolean condition be used to filter a NumPy array?

    Use a Boolean array created by a condition, such as a >= 2, to select the elements for which the condition is true.

  68. How are multiple conditions combined when filtering a NumPy array?

    Use & for elementwise AND and | for elementwise OR.

  69. What kinds of operations does NumPy provide for linear algebra?

    Common operations include dot products, cross products, and matrix transposition.

  70. What are pandas' two principal data structures?

    The Series and the DataFrame.

  71. What is a pandas Series?

    An ordered, one-dimensional sequence of values associated with an index.

  72. How does a pandas Series differ from a Python list?

    A Series has a data type and an explicit index that can use meaningful labels, while a list is indexed by position.

  73. How can a Series index make values easier to access?

    It lets you retrieve a value by a meaningful label rather than remembering its numeric position.

  74. How can you select Series values by position rather than by index label?

    Use the .iloc attribute.

  75. How does label-based slicing in a pandas Series differ from ordinary Python slicing?

    A label-based slice includes its endpoint, unlike a standard Python slice.

  76. How does Boolean filtering work on a pandas Series?

    A condition produces a Boolean Series that can select the values meeting that condition.

  77. Can pandas Series use NumPy-style arithmetic and statistical operations?

    Yes. Series support vectorized operations and common statistical calculations, including operations available through NumPy.

  78. What is a pandas DataFrame?

    A two-dimensional, labeled table of rows and columns, often compared to a spreadsheet.

  79. What information do a DataFrame's index and columns describe?

    index identifies row labels; columns identifies column labels.

  80. What does the DataFrame info method help an analyst inspect?

    The columns, their data types, and how many non-null values they contain.

  81. How do you select DataFrame rows by label and by position?

    Use .loc for label-based selection and .iloc for positional selection.

  82. How can you select a column from a pandas DataFrame?

    Use the column label, such as df['population'], to retrieve that column as a Series.

  83. What does Boolean selection do when applied to a DataFrame?

    It filters rows according to a Boolean condition, such as retaining rows whose population exceeds a threshold.

  84. How does pandas align a Series with a DataFrame during an operation?

    It matches corresponding labels, such as Series labels to DataFrame column names, before applying the operation.

  85. Are most pandas operations in-place by default?

    No. Most return a new object and leave the original unchanged unless the result is assigned or an in-place option is used.

  86. How can you add a new column to a DataFrame?

    Assign a value or a computed Series to a new column label.

  87. How can a DataFrame be used to calculate a derived column?

    Apply vectorized arithmetic to existing columns and assign the result to a new column.

  88. What are the four broad data-cleaning concerns described in the tutorial?

    Missing data, invalid values, values that are implausible for the domain, and duplicate records.

  89. What is the difference between a missing value and an invalid value?

    A missing value is absent; an invalid value is present but does not fit the expected type or allowed values.

  90. Why can judging an implausible value require domain knowledge?

    A value can have the right type yet still be unrealistic in its context.

  91. Which pandas functions can identify missing values?

    isna and isnull identify missing values; notna and notnull identify non-missing values.

  92. How can you count missing values in a pandas Series?

    Apply isna() and then sum().

  93. What does dropna do?

    It returns a Series or DataFrame with missing values removed.

  94. How can you change dropna to drop DataFrame columns instead of rows?

    Set axis=1.

  95. How can a dropna threshold control which rows or columns are kept?

    Use thresh to require a minimum number of non-missing values.

  96. What does fillna do?

    It returns data with missing values replaced by a specified value or method.

  97. How do forward-fill and backward-fill handle missing values?

    Forward-fill propagates the previous available value; backward-fill propagates the next available value.

  98. How can value_counts help clean a categorical column?

    It lists the distinct values and their frequencies, making unexpected categories easier to detect.

  99. How can replace fix inconsistent category labels?

    Map incorrect values to their intended values, such as replacing alternative gender codes with the standard labels.

  100. What is a duplicate record?

    A record that repeats another record according to chosen comparison criteria.

  101. How does pandas duplicated choose which repeated value to mark by default?

    It keeps the first occurrence unmarked and marks later occurrences as duplicates.

  102. How does the subset option affect duplicate detection?

    It limits the columns used to decide whether rows are duplicates.

  103. What is the purpose of pandas string, datetime, and categorical accessors?

    They provide type-specific methods through .str, .dt, and .cat, respectively.

  104. What can pandas string methods do during data cleaning?

    They can split, search, strip, or replace text, including using regular expressions for some operations.

  105. What are the two broad Matplotlib APIs described in the tutorial?

    The stateful global API and the object-oriented API.

  106. Why does the tutorial prefer Matplotlib's object-oriented API?

    It explicitly associates plotting commands with particular axes, making complex figures easier to understand and modify.

  107. What is the relationship between a Matplotlib figure and its axes?

    A figure is the overall container; axes are the individual plotting areas within it.

  108. What kinds of visualizations can Matplotlib create?

    Examples include line plots, scatter plots, histograms, density plots, bar charts, and box plots.

  109. What is a key benefit of a scatter plot with color or marker size mapped to data?

    It can display additional variables beyond the horizontal and vertical coordinates.

  110. How can visualization help with data cleaning?

    Plots can reveal unusual distributions, outliers, gaps, or relationships that merit investigation.

  111. What is a CSV file?

    A text file containing tabular data, with fields separated by a delimiter; despite the name, the delimiter need not be a comma.

  112. How does pandas simplify reading delimited text files?

    Methods such as read_csv parse the file into a DataFrame and provide options for headers, separators, types, dates, and missing-value markers.

  113. How can read_csv handle a file that has no header row?

    Set header=None and provide column names if desired.

  114. How can read_csv parse a file with a non-comma delimiter?

    Specify the separator used between fields.

  115. What do pandas head and tail show?

    head shows the first rows and tail shows the last rows; both can accept a row count.

  116. How can pandas parse a text column as dates?

    Use to_datetime on the column, or request date parsing when reading the file.

  117. How can a DataFrame use a date column for its index while reading a CSV?

    Specify the date column as the index column and request date parsing for it.

  118. How can a pandas DataFrame be written to a CSV file?

    Use the to_csv method.

  119. How does pandas read data from a SQL database?

    Use a SQL-reading function with a query and a database connection, or read a table with an appropriate table-reading method.

  120. What is the difference between reading a SQL query and reading a whole SQL table?

    A query-based read executes supplied SQL; a table-based read retrieves a named table directly.

  121. How can pandas write a DataFrame to a SQL table?

    Use to_sql with a table name and database connection.

  122. What can pandas read_html do?

    It can locate and parse HTML tables into DataFrames.

  123. Why might a DataFrame parsed from an HTML table need cleaning?

    HTML tables are often formatted for people rather than data processing and may contain repeated headers, merged cells, or irregular structure.

  124. How does pandas read Excel workbooks?

    Use read_excel, specifying a file and optionally a sheet; it reads a worksheet into a DataFrame.

  125. What is the purpose of pandas' Excel-file and Excel-writer interfaces?

    An Excel-file interface can inspect workbook information such as sheet names, while an Excel writer supports writing multiple sheets.

  126. How does the tutorial characterize Python as a programming language?

    Python is a high-level, interpreted, dynamically typed, general-purpose language that supports object-oriented and functional programming features.

  127. Which Python version should new learners use, according to the tutorial?

    Python 3.

  128. How does Python use indentation to define code blocks?

    Indentation marks the body of constructs such as functions, conditionals, and loops.

  129. How do you define a function in Python?

    Use def, followed by the function name and parameters, then an indented body.

  130. What does a Python function return if it reaches the end without an explicit return?

    None.

  131. How are comments written in Python?

    A comment begins with the # symbol.

  132. What does it mean that Python is dynamically typed but strongly typed?

    A variable does not need a declared type and can be assigned different types, but incompatible operations are still rejected.

  133. What are Python's principal built-in numeric and Boolean value types?

    Common types include integers, floating-point numbers, decimals through a module, and Boolean values True and False.

  134. What is the difference between a Python list and a tuple?

    Both are ordered sequences, but lists are mutable while tuples are immutable.

  135. What is a Python dictionary?

    A mapping of keys to values, useful for retrieving information by meaningful names.

  136. What are two important properties of Python sets?

    They contain unique values and support fast membership checks.

  137. How does a Python for loop typically iterate?

    It iterates over the elements of a collection or other iterable.

  138. What is a Python while loop, and what risk should programmers consider?

    It repeats while a condition is true; if the condition never becomes false, it can run indefinitely.

  139. How are Python modules used to access library functionality?

    Import a module and use its functions or other contents.

  140. How can Python code handle an operation that may raise an exception?

    Place the operation in a try block and handle the error in an except block.

Card 1 of 140
Card 1 of 140

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent