Julia 1.0 Programming by Ivo Balbaert
Author:Ivo Balbaert
Language: eng
Format: epub
Tags: COM051010 - COMPUTERS / Programming Languages / General, COM018000 - COMPUTERS / Data Processing, COM051440 - COMPUTERS / Software Development and Engineering / Tools
Publisher: Packt Publishing
Published: 2018-09-21T06:15:44+00:00
There is an even simpler literal notation: to concatenate two matrices a and b with the same number of rows to a matrix c, just execute c = [a b]. now b is appended to the right of a. To put b beneath c, use c = [a; b]. The following is a concrete example, a = [1 2; 3 4]and b = [5 6; 7 8]:
a
b
c = [a b]
c = [a; b]
1 2
3 4
5 6
7 8
1 2 5 6
3 4 7 8
1 2
3 4
5 6
7 8
The reshape function changes the dimensions of a matrix to new values if this is possible, for example:
reshape(1:12, 3, 4) #> returns a 3x4 array with the values 1 to 12 3x4 Array{Int64,2}: 1 4 7 10 2 5 8 11 3 6 9 12 a = rand(3, 3) #> produces a 3x3 Array{Float64,2} 3x3 Array{Float64,2}: 0.332401 0.499608 0.355623 0.0933291 0.132798 0.967591 0.722452 0.932347 0.809577 reshape(a, (9,1)) #> produces a 9x1 Array{Float64,2}: 9x1 Array{Float64,2}: 0.332401 0.0933291 0.722452 0.499608 0.132798 0.932347 0.355623 0.967591 0.809577 reshape(a, (2,2)) #> does not succeed: ERROR: DimensionMismatch("new dimensions (2,2) must be consistent
with array size 9")
When working with arrays that contain arrays, it is important to realize that such an array contains references to the contained arrays, not their values. If you want to make a copy of an array, you can use the copy() function, but this produces only a shallow copy with references to the contained arrays. In order to make a complete copy of the values, we need to use the deepcopy() function.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8301)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6746)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6723)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6602)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6383)
Driving Data Quality with Data Contracts by Andrew Jones(6333)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6096)
Learning SQL by Alan Beaulieu(5995)
Weapons of Math Destruction by Cathy O'Neil(5779)
Big Data Analysis with Python by Ivan Marin(5367)
Data Engineering with dbt by Roberto Zagni(4365)
Solidity Programming Essentials by Ritesh Modi(4012)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3873)
Pandas Cookbook by Theodore Petrou(3582)
Blockchain Basics by Daniel Drescher(3294)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2906)
Feature Store for Machine Learning by Jayanth Kumar M J(2815)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2796)
Mastering Python for Finance by Unknown(2744)
