Numpy Array Of Lists To 2d Array

broadcasted [list of arrays] These arrays are views on the original arrays. …So we'll import it as np. The second way a new [0] * n is created each time through the loop. NumPy bietet Funktionen, um Intervalle mit Werten zu erzeugen, deren Abstände gleichmäßig verteilt sind. This page introduces some basic ways to use the object for computations on arrays in Python, then concludes with how one can accelerate the inner loop in Cython. argmax(array, axis = None, out = None) : Returns indices of the max element of the array in a particular axis. Note that numpy. Can anyone help with converting a text file to a 2-D array in Python using NumPy (or something similar)? I have a. array([[1,2,3,4,5]]) results in the correct format. zeros [2]: a = np. What do I need a numpy array for?' Well, there are very significant advantages of using numpy arrays overs lists. It looks like indexing numpy record arrays with an array of indices is outrageously slow. It is the same data, just accessed in a different order. py file import tensorflow as tf import numpy as np We’re going to begin by generating a NumPy array by using the random. R and Python print arrays differently. Since arrays may be multidimensional, you must specify a slice for each dimension of the array: # create the array of size 3 by 4. So use numpy array to convert 2d list to 2d array. Numpy Arrays : Computations Its quite common to assume that Numpy Arrays behave like normal arrays in python except few exceptions, but since numpy array is designed to work on large and complex data sets, the designers of numpy build universal functions for operations on Numpy Arrays. NumPy provides two fundamental objects: an N-dimensional array object and a universal function object. For changing the size and / or dimension, we need to create new NumPy arrays by applying utility functions on the old array. For changing the size and / or dimension, we need to create new NumPy arrays by applying utility functions on the old array. From that docs: Produces a shallow copy of obj—the instance variables of obj are copied, but not the objects they reference. I'm trying to calculate Big-O that my data structure fits and is better than the 2 dimensional array but I'm concerned about three things. array(inputs_list, ndmin=2). We have seen lots of operators in our Python tutorial. Computation on NumPy arrays can be very fast, or it can be very slow. Previous: Write a NumPy program to convert a list and tuple into arrays. The NumPy library is an important Python library for Data Scientists and it is one that you should be familiar with. argmin() returns the index in the flatten array, which is a first step, but I wonder if it is possible to get the coordinates directly as an array, rather than calculating them myself by using this flat index and the shape of the array. Arrays can also be split into separate arrays by calling function hsplit. "+" for the addition of numerical values and the concatenation of strings. Use NumPy with Plotly's Python graphing library to create arrays of data in multiple dimensions, perform operations of data arrays to manipulate and extract info like max or min value and generate random numbers. They are more convenient to deal with. In 2009, the Cray Jaguar performed at 1. Arrays x, y, and zare used to reference the three arrays created in lines 12{14. # numpy-arrays-to-tensorflow-tensors-and-back. array and then one, two, and three. my_numpy_list = np. NumPy Cheat Sheet: Data Analysis in Python This Python cheat sheet is a quick reference for NumPy beginners. My Dashboard; Pages; Python Lists vs. Array inheriting from robjects. 6, provides many flexible ways to visit all the elements of one or more arrays in a systematic fashion. ndarray NumPy arrays are somewhat like native Python lists, except that • Data must be homogeneous (all elements of the same type). And, if you need to do mathematical computation on arrays and matrices, you are much better off using something like NumPy library. Delete given row or column. Fortunately, most of the time when one wants to supply a list of locations to a multidimensional array, one got the list from numpy in the first place. Note that numpy. A numpy array is, in our case, either a two dimensional array of integers (height x width) or, for colour images, a three dimensional array (height x width x 3 or height x width x 4, with the last dimension storing (red,green,blue) triplets or (red,green,blue,alpha) if you are considering transparency). You can use one Numpy array in place of having multiple Python lists. savez(list) doesn't work because savez needs each array individually. Numpy | Array Creation. Selecting List Elements Import libraries >>> import numpy >>> import numpy as np Selective import >>> from math import pi >>> help(str) Python For Data Science Cheat Sheet Python Basics. Test out evaluation features of Synapse with numpy arrays. linspace() is a function that returns an array of evenly spaced numbers over a specified. A slicing operation creates a view on the original array, which is just a way of accessing array data. class rpy2. Like Python lists, Numpy arrays can also be sliced. In addition to the capabilities discussed in this guide, you can also perform more advanced iteration operations like Reduction Iteration, Outer Product Iteration, etc. hstack is simpler than the other options. After exploring the various operations using NumPy, we do a time analysis of the speedup that can be achieved using NumPy. how to convert the hashset back to array. These are explained in the context of computer science and data science to technologists and students in. Arrays are the main data structure used in machine learning. I generate a list of one dimensional numpy arrays in a loop and later convert this list to a 2d numpy array. Slicing: Just like lists in python, NumPy arrays can be sliced. To create a NumPy array containing only zeros we use np. If you need more information then see Arrays in Python. The object type is also special because an array containing object_ items does not return an object_ object on item access, but instead returns the actual object that the array item refers to. Converting Python array_like Objects to NumPy Arrays¶ In general, numerical data arranged in an array-like structure in Python can be converted to arrays through the use of the array() function. concatenate function from the masked array module instead. Unless you don't really need arrays (array module may be needed to interface with C code), don't use them. Having said all of that, let me quickly explain how axes work in 1-dimensional NumPy arrays. The code in this section is extracted from exnumpy. arange() : Create a Numpy Array of evenly… How to Reverse a 1D & 2D numpy array using np. The number of dimensions is the rank of the array; the shape of an array is a tuple of integers giving the size of the array along each dimension. 48 videos Play all Data Manipulation and Processing with Python Noureddin. In the following example, you will first create two Python lists. Therefore, something like a 2 dimensional array by using linked list. They can even contain other lists. 1 Line plots The basic syntax for creating line plots is plt. exp function with a 2-dimensional array. We use cookies to ensure you have the best browsing experience on our website. Is there a way to combine two 1D arrays with the same size into a 2D array? It seems like the internal pointers and strides could be combined. I believe the difference is that my arrays are lists, while yours are just a sequence of digits. txt") Reading from a file (2d) f <- read. Creating A NumPy Array. 9 hours ago · I have a 2D numpy array of zeros, a list of numpy arrays (which can be of different lengths) and a list of indices. In this lesson, we will look at some neat tips and tricks to play with vectors, matrices and arrays using NumPy library in Python. Sort index. Seven lists are loaded into your workspace, each named after a day of the week: monday, tuesday, and so on. Arrays in NumPy erzeugen. Fortunately, most of the time when one wants to supply a list of locations to a multidimensional array, one got the list from numpy in the first place. Also, lists are faster than arrays. Data manipulation in Python is nearly synonymous with NumPy array manipulation: even newer tools like Pandas are built around the NumPy array. Lists and 1-D Numpy Arrays. This section demonstrates the use of NumPy's structured arrays and record arrays, which provide efficient storage for compound, heterogeneous data. The NumPy (Numeric Python) package helps us manipulate large arrays and matrices of numeric data. load, the resultant array is of. How NumPy Arrays are better than Python List - Comparison with examples OCTOBER 4, 2017 by MOHITOMG3050 In the last tutorial , we got introduced to NumPy package in Python which is used for working on Scientific computing problems and that NumPy is the best when it comes to delivering the best high-performance multidimensional array objects and. In cases where a MaskedArray is expected as input, use the ma. They build full-blown visualizations: they create the data source, filters if necessary, and add the. Python, that's what we think! But there exist lots of programming languages which are suitable for solving numerical projects, so even without googling, you can be sure, that there must be different opinions. A structured array in numpy is an array of records. one of the packages that you just can’t miss when you’re learning data science, mainly because this library provides you with an array data structure that holds some benefits over Python lists, such as: being more compact, faster access in reading and writing items, being more convenient and more efficient. Numpy 3: Arrays in numpy; Numpy 1: creating List and arrays in numpy; Scikit-Learn: PCA, KMeans; Scikit-Learn: linear regression, SVM, KNN; Numpy 2: math operation on arrays; Energy minimization; Markov Random Field and the MRF optimization probl March (1) January (11). Below are a few methods to solve the task. In case you want to create 2D numpy array or a matrix, simply pass python list of list to np. These are the basics of matrices. array(inputs_list, ndmin=2). mat = numpy. Accessing Array elemets with index Printing of Array To see type of Array To see shape of Array (use of different functions) NumPy arrays arr also known as ndarray (n-dimentional array). This is a minimum estimation, as Python integers can use more than 28 bytes. If there are not as many arrays as the original array has dimensions, the original array is regarded as containing arrays, and the extra dimensions appear on the result array. On the same machine, multiplying those array values by 1. So you have a list of references, not a list of lists. A way to overcome this is to duplicate the smaller array so that it is the dimensionality and size as the larger array. Merging, appending is not recommended as Numpy will create one empty array in the size of arrays being merged and then just copy the contents into it. Numpy is the de facto ndarray tool for the Python scientific ecosystem. Creating Structured Arrays¶. Performance of Pandas Series vs NumPy Arrays September 5, 2014 September 5, 2014 jiffyclub python pandas numpy performance snakeviz I recently spent a day working on the performance of a Python function and learned a bit about Pandas and NumPy array indexing. uint16, above, means that an array with data type numpy. dot() This function returns the dot product of two arrays. dtype: dtype, optional. A way to overcome this is to duplicate the smaller array so that it is the dimensionality and size as the larger array. pyplot,…which we'll use to plot some of our arrays. Other objects are built on top of these. Indexing can be done in numpy by using an array as an index. b [ True True] a = b [ True True] Python Code Editor: Have another way to solve this solution?. To use the NumPy module, we need to import it using: import numpy Arrays. 42 + 5 "Python is one of the best " + "or maybe the best programming language!". ndarray; index; next; previous; numpy. txt") Reading from a file (2d) f <- read. We can create numpy arrays in different ways in that one of the way is using arange. arange function. In Python, data is almost universally represented as NumPy arrays. Skip navigation Sign in. By adding these two arrays together, we can create the 2D array containing, as its elements, every combination of sums between the numbers in the original elements. 64 + 8 len(lst) + len(lst) 28. The syntax to use the function is given below. The three types of indexing methods that are followed in numpy − field access, basic slicing, and advanced indexing. arange function, along with many… How to make a matplotlib scatter plot - Sharp Sight - […] create the first, x_var, by using the np. Understanding how it works in detail helps in making efficient use of its flexibility, taking useful shortcuts. To do this, we’re going to use the np. But we can check the data type of Numpy Array elements i. dup copies the tainted state of obj. But arrays are also useful because they interact with other NumPy functions as well as being central to other package functionality. 1-dimensional NumPy arrays only have one axis. View 70-511-Week 3. We'll discuss the actual constraints later, but for the case at hand a simple example will suffice: our original macros array is 4x3 (4 rows by 3 columns). Open Digital Education. Change DataFrame index, new indecies set to NaN. Use NumPy with Plotly's Python graphing library to create arrays of data in multiple dimensions, perform operations of data arrays to manipulate and extract info like max or min value and generate random numbers. Starting in NumPy 1. Note that numpy. You can use np. We'll start by looking at the Python built-ins, and then take a look at the routines included in NumPy and optimized for NumPy arrays. Arbitrary data-types can be defined. [Numpy-discussion] Question: arrays of booleans [Numpy-discussion] Question: arrays of booleans. If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this:. txt file that contains information in the following pattern : The data is. array() method as an argument and you are done. However, there is a better way of working Python matrices using NumPy package. table("data. A repository of tutorials and visualizations to help students learn Computer Science, Mathematics, Physics and Electrical Engineering basics. And we will specify an abbreviation…since we'd be referring to NumPy a lot in the future. scipy array tip sheet Arrays are the central datatype introduced in the SciPy package. Find Study Resources. floats and integers, floats and omplex numbers, or in the case of NumPy, operations between any two arrays with different numeric typecodes) first perform a coercion of the 'smaller' numeric type to the type of the `larger' numeric type. We list some common functions below but for a full list see the Array API:. My challenge is how to combine these arrays into a single array or a list so that they can be individually accessed, but all I was getting was a list containing arrays with zero elements. flip()… Sorting 2D Numpy Array by column or row in Python; How to sort a Numpy Array in Python ? How to get Numpy Array Dimensions. If the sub-arrays do not have the same length, this solution will only give you a numpy array of lists (i. array() method. How to combine a pair of 1D arrays?. Thus the original array is not copied in memory. If we program with numpy, we will come sooner or later to the point, where we will need functions to manipulate the shape or dimension of arrays. txt file that contains information in the following pattern : The data is. Array inheriting from robjects. I am working on lung CT images from luna16 dataset, the dataset have a 3d lung image and a label from CSV file, I have a code for constructing 2d list from 3d array 25x25x25 (the 3d image) and a label [0,1] or [1,0] from CSV file, after creating the 2d list I want to save it in numpy file, below is my code for creating the 2d list and saving it. These are explained in the context of computer science and data science to technologists and students in. Create an array arr equals np. Numpy arrays have contiguous memory allocation. Note however, that this uses heuristics and may give you false positives. I have a 2-D NumPy array containing floating point values. Return the sorted, unique values that are in both of the input arrays. This is a dictionary-like object which can be queried for its list of arrays (with the. Machine learning data is represented as arrays. We already imported NumPy using input NumPy as np so we can start using it right away. Main issue is that numpy assumes your list must become an array, but that is not what I am looking for. The ability to analyze data with Python is critical in data science. According to documentation of numpy. That way there is no copying being done, so you end up with an actual list of lists. Fortunately, most of the time when one wants to supply a list of locations to a multidimensional array, one got the list from numpy in the first place. Syntactically, NumPy arrays are similar to python lists where we can use subscript operators to insert or change data of the NumPy arrays. [Numpy-discussion] Question: arrays of booleans [Numpy-discussion] Question: arrays of booleans. reshape , it returns a new array object with the new shape specified by the parameters (given that, with the new shape, the amount of elements in the array remain unchanged) , without changing the shape of the original object, so when you are calling the. sort() function does not allow us to sort an array in descending order. array(inputs_list, ndmin=2). nonzero(B%2) >>> idx (array([0, 1, 1, 2]), array([1, 0, 2, 1])) >>> B[idx] array([1, 3, 5, 7]) >>> B[B%2 != 0] array([1, 3, 5, 7]). scipy array tip sheet Arrays are the central datatype introduced in the SciPy package. # import numpy import numpy as np Let us create a NumPy array using arange function in NumPy. The only difference is that here we used two NumPy arrays instead of two lists. 28507 seconds. plot(x,y), where x and y are arrays of the same length that specify the (x;y) pairs that form the line. If a is any numpy array and b is a boolean array of the same dimensions then a[b] selects all elements of a for which the corresponding value of b is True. In Python, the Numpy library is indispensable for working with numeric arrays, vectors and matrices, build graphs and histograms. NumPy arrays are designed to handle large data sets efficiently and with a minimum of fuss. array() method as an argument and you are done. • These types must be one of the data types (dtypes) provided by NumPy. Selecting List Elements Import libraries >>> import numpy >>> import numpy as np Selective import >>> from math import pi >>> help(str) Python For Data Science Cheat Sheet Python Basics. Data for CBSE, GCSE, ICSE and Indian state boards. Arrays can be stacked into a single array by calling Numpy function hstack. Now, let's look into some of the operations you can do with Numpy arrays. The most import data structure for scientific computing in Python is the NumPy array. class rpy2. When I first answered this question in about_Arrays, I didn't really know mu. Here is a list of things we can do with NumPy n-dimensional arrays which is otherwise difficult to do. sin ( x ). It is also known by the alias array. char module for fast vectorized string operations. Basics¶ Numerical arrays are not yet defined in the standard Python language. So, how do I traverse the array quickly?. They are similar to lists, except that every element of an array must be the same type. No need to retain everything, but have the reflex to search in the documentation (online docs, help(), lookfor())!! For advanced use: master the indexing with arrays of integers, as well as broadcasting. A normal way to do this is something like: >>> idx = np. It looks like indexing numpy record arrays with an array of indices is outrageously slow. Numpy Arrays: Concatenating, Flattening and Adding Dimensions So far, we have learned in our tutorial how to create arrays and how to apply numerical operations on numpy arrays. NumPy arrays can execute vectorized operations, processing a complete array, in contrast to Python lists, where you usually have to loop through the list and execute the operation on each element. If we program with numpy, we will come sooner or later to the point, where we will need functions to manipulate the shape or dimension of arrays. All NumPy wheels distributed on PyPI are BSD licensed. Often it is better to do calculations in numpy form but return results in standard library form, say list or tuple. Python, that's what we think! But there exist lots of programming languages which are suitable for solving numerical projects, so even without googling, you can be sure, that there must be different opinions. Learn to work with the Numpy array, a faster and more powerful alternative to the list. Lists and 1-D Numpy Arrays. …While we are doing this,…let's also import matplotlib. Find the index of value in Numpy Array using numpy. intersect1d¶ numpy. In this post, we are going to see the ways in which we can change the dtype of the given numpy array. NumPy Array Object Exercises, Practice and Solution: Write a NumPy program to convert a list and tuple into arrays. Numpy arrays make it easy to run calculations on data as needed, while Python lists do not support these kinds of calculations. # numpy-arrays-to-tensorflow-tensors-and-back. In addition to the capabilities discussed in this guide, you can also perform more advanced iteration operations like Reduction Iteration, Outer Product Iteration, etc. Its main data object is the ndarray, an N-dimensional array type which describes a collection of "items" of the. These are explained in the context of computer science and data science to technologists and students in. There are functions provided by Numpy to create arrays with evenly spaced values within a given interval. Arrays such as linspace and arange are typically used to constuct N-D arrays used to plot in 3 dimensions. Joining and Stacking of NumPy arrays; NumPy Eye array example; NumPy generate random number array; How to create Zeros NumPy arrays? NumPy Logical operations for selectively picking values from an array depending on a given condition; How to get 1, 2 or 3 dimension NumPy array? Flips the order of the axes of an NumPy Array. NumPy, an acronym for Numerical Python, is a package to perform scientific computing in Python efficiently. Re: [Numpy-discussion] Using objects in arrays. Numpy generalizes this concept into broadcasting - a set of rules that permit element-wise computations between arrays of different shapes, as long as some constraints apply. Python arrays are a special variable that have the ability to hold more than one value and could be stored into single variables. Numpy Arrays: Indexing & Slicing This tutorial covers indexing and slicing. In 2009, the Cray Jaguar performed at 1. Array ¶ In R, arrays are simply vectors with a dimension attribute. A quick overview NumPy functionality can be found here. You will use Numpy arrays to perform logical, statistical, and Fourier transforms. Each record can contain one or more items which can be of different types. For example, subsetting (using the square bracket notation on lists or arrays) works exactly the same. NumPy is a package that defines a multi-dimensional array object and associated fast math functions that operate on it. R/S-Plus Python Description; f <- read. Some of the key advantages of Numpy arrays are that they are fast, easy to work with, and give users the opportunity to perform calculations across entire arrays. Indexing and slicing. If no __array_function__ methods exists, NumPy will default to calling its own implementation, intended for use on NumPy arrays. The important thing to know is that 1-dimensional NumPy arrays only have one axis. array([1, 4, 5, 8], float) >>> a array([ 1. Here, we've used the NumPy array function to create a 2-dimensional array with 2 rows and 6 columns. By adding these two arrays together, we can create the 2D array containing, as its elements, every combination of sums between the numbers in the original elements. Arbitrary data-types can be defined. You can use one Numpy array in place of having multiple Python lists. The following program creates two arrays pand qin lines 3 and 6, then it stacks them into array newa in line 7. I have a list of N dimensional NumPy arrays. Both are shown in the below figure. How to use Numpy Arrays in Python DataCamp. Secondly, this is probably just a display issue. In Python, data is almost universally represented as NumPy arrays. NumPy Basics: Arrays and Vectorized Computation NumPy, short for Numerical Python, is the fundamental package required for high performance scientific computing and data analysis. When applied to a 2D numpy array, numpy simply flattens the array. It includes random. Is there a way to combine two 1D arrays with the same size into a 2D array? It seems like the internal pointers and strides could be combined. These are explained in the context of computer science and data science to technologists and students in. txt") f = fromfile("data. The function supports all the generic types. Learn to create NumPy arrays from lists or tuples in this video tutorial by Charles Kelly. list and array are not the same. txt file that contains information in the following pattern : The data is. scipy array tip sheet Arrays are the central datatype introduced in the SciPy package. txt") f = fromfile("data. The axes of 1-dimensional NumPy arrays work differently. Joining or Concatenating Numpy Arrays- For joining or concatenating of two or more existing ndarrays, python provides following functions- 1. Furthermore, more than one element of a broadcasted array may refer to a single memory location. We use cookies for various purposes including analytics. pptx from AA 170-511 Statistical Programming Week 3 - Data Processing Using Array Outline • • • • • Use NumPy for efficient storage of arrays Perform vector. 0000001 in a regular floating point loop took 1. rand(5000, 1, 5); b = np. Thus if a same array stored as list will require more space as compared to arrays. Show last n rows. Fast Sorting in NumPy: np. So use numpy array to convert 2d list to 2d array. Arrays with different sizes cannot be added, subtracted, or generally be used in arithmetic. It also provides simple routines for linear algebra and fft and sophisticated random-number generation. The standard way to bin a large array to a smaller one by averaging is to reshape it into a higher dimension and then take the means over the appropriate new axes. I have looked on google and here on stack overflow already, yet it seems nowhere to be found. …The simplest way to create a NumPy array…is by converting a Python list…and let's look at it immediately. I'm trying to do so with rasterio with the following piece of code: out_meta =. Python Numpy Tutorial: Installation, Arrays And Random Sampling. rand(1, 500, 5); result = a Stack Exchange Network Stack Exchange network consists of 175 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. zeros¶ numpy. zeros (shape, dtype=float, order='C') ¶ Return a new array of given shape and type, filled with zeros. All of this is made much simpler using Dynamic Array Functions. How to "reduce" a numpy array using a costum binary function; Why is indexing into an numpy array that slow? Why does numpy. The Infra Standard aims to define the fundamental concepts upon which standards are built. Ruby: How to copy the multidimensional array in new array? ruby-on-rails,arrays,ruby,multidimensional-array. Broadcasting provides a means of vectorizing array operations. For example, this means that any scalar is in fact a vector of length one. The only difference is that here we used two NumPy arrays instead of two lists. uint8 to create an array with a byte data type (suitable for bit depths up to 8). loadtxt(fname = "filename. This guide only gets you started with tools to iterate a NumPy array. com Variable Assignment Strings >>> x=5 >>> x 5 >>> x+2 Sum of two variables 7. Sort columns. The number of axes is rank. Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices. I have a numpy_array. Sorting 2D Numpy Array by column or row in Python; numpy. Arrays such as linspace and arange are typically used to constuct N-D arrays used to plot in 3 dimensions. These are explained in the context of computer science and data science to technologists and students in. The NumPy library provides an array data structure that holds some benefits over Python lists, like–faster access in reading and writing items, is more compact, and is more convenient and efficient. NumPy is a Python Library/ module which is used for scientific calculations in Python programming. rand(5000, 1, 5); b = np. And we will specify an abbreviation…since we'd be referring to NumPy a lot in the future. A slicing operation creates a view on the original array, which is just a way of accessing array data. Welcome - Let's take a look at NumPy arrays. NumPy arrays can execute vectorized operations, processing a complete array, in contrast to Python lists, where you usually have to loop through the list and execute the operation on each element. NumPy Array Object Exercises, Practice and Solution: Write a NumPy program compare two arrays using numpy. You can also expand your function to calculate the statistics separately for each row or each column in the two-dimensional numpy array, using the axes of numpy arrays. Python NumPy Array Object [100 exercises with solution] Write a Python program to append values to the end of an array. NumPy arrays also use much less memory than built-in Python sequences. Finally, let's combine two 2-dimensional NumPy arrays. 75 petaFLOPS, beating the IBM Roadrunner for the number one spot on the TOP500 list. You can treat lists of a list (nested list) as matrix in Python. Creating Structured Arrays¶. This section demonstrates the use of NumPy's structured arrays and record arrays, which provide efficient storage for compound, heterogeneous data. I have looked on google and here on stack overflow already, yet it seems nowhere to be found. They build full-blown visualizations: they create the data source, filters if necessary, and add the. 9 hours ago · I have a 2D numpy array of zeros, a list of numpy arrays (which can be of different lengths) and a list of indices. txt") f = load. A quick overview NumPy functionality can be found here. exp with a multi-dimensional array Finally, let's use the numpy. The mlab plotting functions take numpy arrays as input, describing the x, y, and z coordinates of the data. The 1d-array starts at 0 and ends at 8. That way there is no copying being done, so you end up with an actual list of lists.