Skim through the documentation for np.tile
, and use this function to construct the array:
[[4, 3, 4, 3, 4, 3],
[2, 1, 2, 1, 2, 1],
[4, 3, 4, 3, 4, 3],
[2, 1, 2, 1, 2, 1]]
# clean up kernel | |
%reset -f | |
# This is a bit of magic to make matplotlib figures appear inline in the notebook | |
# rather than in a new window. | |
%matplotlib inline | |
# Some more magic so that the notebook will reload external python modules; | |
# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython | |
%load_ext autoreload |
Say we want to concatenate elements within a JavaScript array (or Python list). i.e.
['hello', 'world', '123', '!!!']
hello world 123 !!!
This post shows the similarity (and difference) of the JavaScript and Python syntax. (in case you start using JavaScript but from a Python background. Or vice versa, start using Python but from a JavaScript background)
In Octave, the string manipulation function strtok()
can be very handy for scanning through words in a long sentence.
In the following example, we have a sentence:
'hello world how are you'
Assuming all words are separated by a white space, we can repeat this command to extract (1) the word string tok
and the remaining sentence s
.
Whilst working through the many (Octave) coding assignment from Andrew Ng's Stanford Machine Learning course, a common problem that I have to solve revolves around this:
Given a Matrix A with m rows, and n columns find the mininum (or maximum) value and the associated row and column number
This article summarises my solution to this problem (which, hopefully this will also come in hadny to you!). Note that Octave index start from 1 (instead of 0).
Say we have a Matrix A that look like this:
(Note: this post is in draft mode and is to be updated... JC)
# Intro
Throughout 2017 I will be supporting Clare on becoming a beekeeper. I've never done beekeeping myself before and thought this would be a good opportunity to learn together. Being an Intel Software Innvoator myself I am also keen to potentially build a tech project aligning to beekeeping. No idea as to the problems and solutions just yet. This post serves as a draft scribble notepad for ease of quick references. Will probably put something together to the Intel Developer Mash at some point.
I did 11 hackathons over 11 weeks during Autumn 2015 - in the end I came to realise some important strengths of a physical human being:
the ability to learn, adapt, and evolve
So much have I learnt and grown over these intensive 11 weeks - so I wrote 3 blog posts summarising this personal experience. Enjoy :-)