Mathalope

Search
Skip to content
  • Blog
  • Small Projects
    • Deep Learning on Intel Nervana AI Cluster (aka Colfax HPC Cluster)
    • Intel Colfax Cluster – Notes – Index Page
    • Intel Edison Workshop Tutorials
    • Accelerated C++ Solutions
    • Exploratory Data Analysis – Diamonds
    • GitHub – OpenCV-Python Tutorial Walkthrough
    • Google Earth Engine Projects
    • IPython Notebook – Tentative NumPy Tutorial
    • Small Project – Sampling Distribution – Mean Dice Score
    • swirl – R Programming – Console Log Index Page
    • Video Tracking Project – With OpenCV
    • Project Full-stack
  • Study Notes
    • Udacity – Authentication and Authorization – OAuth – Notes
    • Udacity – Configuring Linux Web Servers – Notes
    • Udacity – Data Analysis with R – Notes
    • Udacity – Full Stack Foundations
    • Udacity – Intro to Algorithm – Notes
    • Udacity – Intro to Artificial Intelligence – Notes
    • Udacity – Intro to Computer Science – Study Notes
    • Udacity – Intro to Data Science – Notes
    • Udacity – Intro to Descriptive Statistics – Study Notes
    • Udacity – Intro to HTML and CSS – Notes
    • Udacity – Intro to Inferential Statistics – Study Notes
    • Udacity – Intro to Relational Databases – Notes
    • Udacity – JavaScript Basics – Notes
    • Udacity – Linux Command Basics
    • Udacity – Programming Foundations with Python – Notes
    • Udacity – Web Development – Notes
  • About
  • Useful Resources
numpy

NumPy Array Broadcasting: Combine 1D arrays into 2D

May 19, 2017 Johnny

This NumPy Array Broadcasting example is inspired by this SciPy Lecture Chapter on Array Broadcasting.

Code:

Output:
array_broadcast_plot

Note the use of y[:, np.newaxis].

Note also that this example might be made much simplier with np.ogrid and np.mgrid. (See the SciPy-Lectures chapter on broadcasting)

Share this:

  • Facebook
  • Tumblr
  • Twitter
  • LinkedIn
  • More
  • Reddit
  • Pinterest
  • Pocket
  • Print
Array BroadcastingMatplotlibnumpy

Post navigation

Previous PostIPython Jupyter Notebook Trick – Auto Module Reload and Inline Chart PlottingNext PostNumPy Exercise – Argsort and Fancy Indexing

Author

Johnny Chan

Johnny Chan

Consultant, Data Analyst, Developer.

View Full Profile →

Intel Software Innovator Logo

Google Ads

Google Ads

Top Articles

  • 3.5 years later... 140,000 visitors from 180+ countries. 2017 Year-end Reflection
    3.5 years later... 140,000 visitors from 180+ countries. 2017 Year-end Reflection

Recent Comments

  • anand on Accelerated C++ Solution to Exercise 5-0 (Part 1 / 3)
  • anand on 3.5 years later… 140,000 visitors from 180+ countries. 2017 Year-end Reflection
  • wonderlander on OpenCV-Python – How to install OpenCV-Python package to Anaconda (Windows)
  • Anonymous on swirl – R Programming – Lesson 8 – Logic
  • PSP on OpenCV-Python – How to install OpenCV-Python package to Anaconda (Windows)
  • Anonymous on Accelerated C++ Solution to Exercise 1-1
  • Anonymous on Accelerated C++ Solution to Exercise 1-1
  • Ruotong Jia on Accelerated C++ Solution to Exercise 4-8
  • Ruotong Jia on Accelerated C++ Solution to Exercise 4-4
  • Ses on swirl – R Programming – Lesson 9 – Functions

Google Ads

Recent Posts

  • 3.5 years later… 140,000 visitors from 180+ countries. 2017 Year-end Reflection January 9, 2018
  • atlas7.githib.io November 24, 2017
  • JavaScript – Bind Intuition – Devil taking over Jim example November 3, 2017
  • How to setup Tensorflow Jupyter Notebook on Intel Nervana AI Cluster (Colfax) For Deep Learning September 25, 2017
  • How to setup PyTorch Jupyter Notebook on Intel Nervana AI Cluster (Colfax) For Deep Learning September 25, 2017
  • Initialize Numpy Arrays with Tuple Unpacking Technique – np.random.rand and np.zeros examples September 13, 2017
  • High Performance Computing (HPC) Running Intel Xeon Phi: N-body Simulation Example September 7, 2017
  • Intel Colfax Cluster – Targeting a Specific Instruction Set / Intel Processor Architecture August 22, 2017
  • Intel Colfax Cluster – Estimate Theoretical Peak FLOPS for Intel Xeon Phi Processors August 21, 2017
  • Intel Colfax Cluster – Optimize a Numerical Integration Implementation with Parallel Programming and Distributed Computing August 17, 2017

Tags

Accelerated C++ AI C++ Colfax Colfax Research Computer Science Descriptive Statistics diamonds Distributed Computing EDA Exercises Exploratory Data Analysis ggplot2 histogram HPC hypothesis testing Inferential Statistics Intel Intro to Data Science JavaScript Machine Learning Mathematics Modern Code numpy OOP OpenCv Optimization Programming Python R Recursion ruby-on-rails sampling distribution Scientific Programming Simple Solution small projects Solutions Statistics swirl Udacity unsupervised learning Web Development Wordpress xeon Xeon Phi

Google Ads

Pages

  • About
  • Accelerated C++ Solutions
  • Alexa Development – Notes
  • Books
  • Deep Learning on Intel Nervana AI Cluster (aka Colfax HPC Cluster)
  • Exploratory Data Analysis – Diamonds
  • Google Earth Engine Projects
  • High Performance Computing (HPC) with Intel Xeon Phi, Parallel Programming, and Distributed Computing
  • Intel Edison Workshop Tutorials
  • Machine Learning Practitioner – Study Plan and Milestones
  • Project Full-stack
  • Small Project – Sampling Distribution – Mean Dice Score
  • Small Projects – Intro
  • Small Projects – Project List
  • swirl – R Programming – Console Log Index Page
  • Ubuntu / Linux command cheatsheet
  • Udacity – Authentication and Authorization – OAuth – Notes
  • Udacity – Configuring Linux Web Servers – Notes
  • Udacity – Data Analysis with R – Notes
  • Udacity – Full Stack Foundations
  • Udacity – Intro to AJAX
  • Udacity – Intro to Algorithm – Notes
  • Udacity – Intro to Artificial Intelligence – Notes
  • Udacity – Intro to Computer Science – Study Notes
  • Udacity – Intro to Data Science – Notes
  • Udacity – Intro to Descriptive Statistics – Study Notes
  • Udacity – Intro to HTML and CSS – Notes
  • Udacity – Intro to Inferential Statistics – Study Notes
  • Udacity – Intro to Relational Databases – Notes
  • Udacity – JavaScript Basics – Notes
  • Udacity – Linux Command Basics
  • Udacity – Programming Foundations with Python – Notes
  • Udacity – Web Development – Notes
  • Useful Resources
  • Video Tracking Project – With OpenCV

Google Ads

Categories

  • Artificial Intelligence (14)
  • Blogging (4)
  • cheatsheet (1)
  • Colfax (16)
  • Computer Science (40)
  • CUDA (1)
  • Data Science (3)
  • Deep Learning (2)
  • docker (1)
  • Exploratory Data Analysis (EDA) (22)
    • ggplot2 – diamonds (17)
  • Github (1)
    • Gist (1)
  • Good Practice (1)
  • Hackathon (2)
  • HPC (1)
  • Intel Edison (2)
  • IPython (1)
  • JavaScript (9)
  • kaggle (1)
  • Mac (2)
  • Machine Learning (7)
  • Maths (8)
  • OpenCV (4)
  • OpenCV-Python (2)
  • Other (1)
  • Programming (216)
    • C++ (93)
    • OOP (8)
    • Python (80)
      • cv2 (4)
      • numpy (10)
    • R (35)
    • Ruby (2)
  • Ruby-on-Rails (5)
  • SAS (2)
  • Software Development (2)
  • Spreadsheet (2)
  • SQL (2)
  • Statistics (19)
    • Descriptive Statistics (12)
    • Inferential Statistics (10)
  • Udacity (120)
  • Uncategorized (10)
  • Useful Tools (10)
    • IPython Notebook (1)
    • Sublime Text (3)
  • Video Tracking Project (1)
  • Videos (2)
  • Visualization (3)
  • Web Development (7)
  • Windows (1)
  • Wordpress (4)

Google Ads

Calendar

May 2017
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Apr   Jun »

Archives

  • January 2018 (1)
  • November 2017 (2)
  • September 2017 (4)
  • August 2017 (18)
  • July 2017 (2)
  • June 2017 (1)
  • May 2017 (9)
  • April 2017 (3)
  • October 2016 (2)
  • September 2016 (1)
  • May 2016 (1)
  • April 2016 (1)
  • March 2016 (3)
  • February 2016 (4)
  • January 2016 (12)
  • December 2015 (3)
  • October 2015 (3)
  • September 2015 (4)
  • August 2015 (1)
  • July 2015 (8)
  • June 2015 (6)
  • May 2015 (12)
  • April 2015 (54)
  • March 2015 (52)
  • February 2015 (4)
  • October 2014 (4)
  • September 2014 (30)
  • August 2014 (18)
  • July 2014 (24)
  • June 2014 (22)

A Scientific Programming Sketchbook

  • Accelerated C++ Solutions
Copyright © 2025 Mathalope