Data Structures – 2D Lists

Slides:



Advertisements
Similar presentations
Browse the codebook - to see the list of variables on which you can do statistics select the “Browse codebook in this window” option and then click “Start”
Advertisements

Two-Dimensional Arrays Chapter What is a two-dimensional array? A two-dimensional array has “rows” and “columns,” and can be thought of as a series.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 8 Arrays.
1 More on Arrays Passing arrays to or from methods Arrays of objects Command line arguments Variable length parameter lists Two dimensional arrays Reading.
©2004 Brooks/Cole Chapter 8 Arrays. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Sometimes we have lists of data values that all need to be.
CS Data Structures Chapter 2 Arrays and Structures.
1 Arrays  Arrays are objects that help us organize large amounts of information  Chapter 8 focuses on: array declaration and use passing arrays and array.
1 times table 2 times table 3 times table 4 times table 5 times table
Table of Contents Matrices - Multiplication Assume that matrix A is of order m  n and matrix B is of order p  q. To determine whether or not A can be.
One Dimensional Arrays. Declaring references to array objects How would you declare a variable somearray that is an array of ints? int[] somearray;
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
Multiplying Fractions A Visual Lesson. When you multiply two numbers, do they always get larger? Are you sure?
Arrays- Part 2 Spring 2013Programming and Data Structure1.
Course Title Object Oriented Programming with C++ Course instructor ADEEL ANJUM Chapter No: 05 ARRAY 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER) 1.
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
Computer Science: A Structured Programming Approach Using C1 8-7 Two-Dimensional Arrays The arrays we have discussed so far are known as one- dimensional.
 Decide on the information needed, and create column headings. (See picture below.)
An Introduction to Programming with C++ Fifth Edition Chapter 11 Arrays.
Computer Programming TCP1224 Chapter 11 Arrays. Objectives Using Arrays Declare and initialize a one-dimensional array Manipulate a one-dimensional array.
Periodic Table Study Guide Determining Shells and Valence Electrons
Reading the Periodic Table. The Periodic Table Layout The Periodic Table is organized into rows and columns Each vertical column is called a Group or.
Lookup Function (Think of a Book Index).  Need to fill based on what is in the these fields Array table.
Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened.
A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows.
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
Computer Science: A Structured Programming Approach Using C1 8-7 Two-Dimensional Arrays The arrays we have discussed so far are known as one- dimensional.
Learn: to organize and interpret data in frequency tables to organize and interpret data in frequency tables.
1 Arrays of Arrays Quick review … arrays Arrays of arrays ≡ multidimensional array Example: times table Representation in memory Ragged arrays Example:
Tables Learning Support
Advanced Tables. Let's build some tables using each of these features and then try combining both features into the same table. Spanning Rows and Columns.
What does this say? Matrix Multiplication ! What does this say?
Lecture #15 ARRAYS By Shahid Naseem (Lecturer). 2 ARRAYS DEFINITION An array is a sequence of objects of same data type. The objects in an array are also.
Python is Awesome! (and cooler than R). My Research.
1 2-d Arrays. 2 Two Dimensional Arrays We have seen that an array variable can store a list of values Many applications require us to store a table of.
How to Draw Bohr Diagrams and Lewis Dot Structures Al.
$200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200.
Two-Dimensional Arrays
Lecture 8: 2D Arrays and Nested Loops
Two-Dimensional Arrays
Microsoft Visual Basic 2005: Reloaded Second Edition
Two-dimensional arrays
Two Dimensional Array Mr. Jacobs.
Introduction to PL/SQL Programing
Muybridge Lab CSD 340 (Blum).
Chapter 1: Data Structures 1A, B
JavaScript: Functions.
Times Tables.
Repeating Instructions And Advance collection
Data Structures – 1D Lists
Multidimensional Arrays
Let’s Learn About Spreadsheets
Calendar like the Periodic Table
Multidimensional array
HTML Tables.
CS2011 Introduction to Programming I Multidimensional Arrays
Core Chemistry Revision Questions
ARRAYS 2 GCSE COMPUTER SCIENCE.
STORE MANAGER RESPONSIBILITIES.
Dr Tripty Singh Arrays.
CHAPTER 2 Arrays and Vectors.
Matrix Addition
Functions.
Multi-Dimensional Arrays
CHAPTER 2 Arrays and Vectors.
2-Dimensional Lists (Matrices) in Python
Introduction to Computer Science
Modules Programming Guides.
3 times tables.
6 times tables.
Browse the codebook - to see the list of variables on which you can do statistics select the “Browse codebook in this window” option and then click “Start”
Presentation transcript:

Data Structures – 2D Lists Programming Guides

Data Structures – 2D Lists 2D Lists in Python Lists allow us to store more than one item of data under the same identifier. Lists can also contain lists themselves. These are known as 2D lists and we can create 2 dimensional lists with ease. A 2 dimensional list is simply: ‘lists inside a list’

Data Structures – 2D Lists 1D Lists in Python As we have already seen, a 1 dimensional list can be coded in python like this: List = [23, 3, 1, 4] Where: List[0] = 23 List[1] = 3 List[2] = 1 List[3] = 4

Data Structures – 2D Lists 2D Lists in Python A 2 dimensional list is simply: ‘lists inside a list’ A 2 dimensional list can be coded in python like this: List = [[23, 3, 1, 4],[5, 22, 6, 3]] Where: List[0] = [23, 3, 1, 4] List[1] = [5, 22, 6, 3] List[0][0] = 23 List[0][3] = 4 List[1][1] = 22 List[1][2] = 6

A list of lists! A 2D list can be declared like this: two_dim_list 1 2 r1c1 r1c2 r1c3 r2c1 r2c2 r2c3 A visual interpretation of two_dim_list:

A list of lists! Table Row 1 Row 2 1 2 r1c1 r1c2 r1c3 r2c1 r2c2 r2c3 Row 1, Column 1 Row 1, Column 3 Row 2, Column 2 Row 1, Column 2 Row 2, Column 1 Row 2, Column 3 1 2 r1c1 r1c2 r1c3 r2c1 r2c2 r2c3 A visual interpretation of two_dim_list:

Examples of 2D lists in action: