Main public logs
From Master of Neuroscience Wiki
Combined display of all available logs of Master of Neuroscience Wiki. You can narrow down the view by selecting a log type, the username (case-sensitive), or the affected page (also case-sensitive).
- 13:03, 17 October 2025 Davrot talk contribs uploaded File:23897 4.png
- 13:03, 17 October 2025 Davrot talk contribs created page File:23897 3b.png
- 13:03, 17 October 2025 Davrot talk contribs uploaded File:23897 3b.png
- 13:02, 17 October 2025 Davrot talk contribs created page File:23897 3a.png
- 13:02, 17 October 2025 Davrot talk contribs uploaded File:23897 3a.png
- 13:02, 17 October 2025 Davrot talk contribs created page File:23897 2.png
- 13:02, 17 October 2025 Davrot talk contribs uploaded File:23897 2.png
- 13:02, 17 October 2025 Davrot talk contribs created page File:23897 1.png
- 13:02, 17 October 2025 Davrot talk contribs uploaded File:23897 1.png
- 13:01, 17 October 2025 Davrot talk contribs created page File:23897 0.png
- 13:01, 17 October 2025 Davrot talk contribs uploaded File:23897 0.png
- 12:58, 17 October 2025 Davrot talk contribs created page Statistics (Created page with "== The goal == There are other (more extensive) statistics packages like * [https://docs.scipy.org/doc/scipy/reference/stats.html scipy.stats] * [https://pingouin-stats.org/build/html/index.html pingouin] * [https://www.statsmodels.org/stable/index.html statsmodels] Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.fisher_exact.html#scipy.stats.fisher_exact Fisher Exact Test] == The [ht...") Tag: Visual edit
- 12:58, 17 October 2025 Davrot talk contribs created page Random numbers the non-legacy way (Created page with "== Goal == If you don’t see something like '''np.random.default_rng()''' in your code then you are probably using the old [https://numpy.org/doc/stable/reference/random/legacy.html#legacy-random-generation Legacy Random Generation]. '''Don’t use the [https://numpy.org/doc/stable/reference/random/legacy.html legacy] methods''' for new source code!!! '''numpy.random.random() == old == bad == don’t use''' Do it like this:<syntaxhighlight lang="python">import num...") Tag: Visual edit
- 12:57, 17 October 2025 Davrot talk contribs created page Linear algebra (Created page with "== The goal == Overview over the linear algebra functions of Numpy. Questions to [mailto:davrot@uni-bremen.de David Rotermund] '''There more functions in the [https://docs.scipy.org/doc/scipy/reference/linalg.html scipy linalg package]!!!''' == The @ operator == @ => Matrix product * => outer product A[i] * B[i] The @ operator is preferable to other methods when computing the matrix product between 2d arrays. The numpy.matmul function implements the @ oper...") Tag: Visual edit
- 12:56, 17 October 2025 Davrot talk contribs created page Math functions (Created page with "== The goal == Matrices alone are useless. We need some math functions to act upon them. Questions to [mailto:davrot@uni-bremen.de David Rotermund] '''I will focus on the important ones. Those will get a link.''' == [https://numpy.org/doc/stable/reference/routines.math.html#trigonometric-functions Trigonometric functions] == {| class="wikitable" |[https://numpy.org/doc/stable/reference/generated/numpy.sin.html#numpy.sin sin](x, /[, out, where, casting, order, …]) |T...") Tag: Visual edit
- 12:55, 17 October 2025 Davrot talk contribs created page Constants (Created page with " == The goal == Numpy provides plenty of constants. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/constants.html The most important ones] == {| class="wikitable" |numpy.inf |IEEE 754 floating point representation of (positive) infinity. |- |numpy.nan |IEEE 754 floating point representation of Not a Number (NaN). |- |numpy.e |Euler’s constant, base of natural logarithms, Napier’s constant. e = 2.718281828459...") Tag: Visual edit
- 12:54, 17 October 2025 Davrot talk contribs created page Available dtypes (Created page with "== The goal == A numpy matrix can have differnt dtype or – in other words – differnt types of numbers with different precisions. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/arrays.scalars.html#sized-aliases Signed integer types] == '''Please use numpy.int8, numpy.int16, numpy.int32, and numpy.int64 !!!''' * ''numpy.int8'': ** 8-bit signed integer (-128 to 127). Compatible with C char. ** ''numpy.byte'...") Tag: Visual edit
- 12:53, 17 October 2025 Davrot talk contribs created page Ravel and UnRavel (Created page with " == Top == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.ravel_multi_index.html numpy.ravel_multi_index] == <syntaxhighlight lang="python">numpy.ravel_multi_index(multi_index, dims, mode='raise', order='C')</syntaxhighlight><blockquote>Converts a tuple of index arrays into an array of flat indices, applying boundary modes to the multi-index.</blockquote><syntaxhighlight lang="python">import numpy as...") Tag: Visual edit
- 12:46, 17 October 2025 Davrot talk contribs created page Advanced Indexing (Created page with "== The goal == Beside slicing there is something called advanced indexing Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/user/basics.indexing.html#boolean-array-indexing Boolean Array] == We can use Boolean arrays for more complicate indexing:<syntaxhighlight lang="python">import numpy as np a = np.arange(1,10).reshape(3,3) b = np.zeros_like(a) b[a.sum(axis=1) > 6, :] = 1 print(a) print() print(b)</syntaxhighlight>Outp...") Tag: Visual edit
- 12:45, 17 October 2025 Davrot talk contribs created page Boolean matricies and logic functions (Created page with "== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Boolean matrices == There are different ways to get a Boolean matrix. For example the result of a '''np.isfinite()''' (checks if the values in a matrix are infite values) is a Boolean matrix.<syntaxhighlight lang="python">import numpy as np a = 1.0 / np.arange(0, 6).reshape((2, 3)) print(a) print() print(np.isfinite(a))</syntaxhighlight>Output:<syntaxhighlight lang="python"> inf 1....") Tag: Visual edit
- 12:44, 17 October 2025 Davrot talk contribs created page Extending an existing matrix: tile, repeat, pad (Created page with "== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.tile.html numpy.tile] == <syntaxhighlight lang="python">numpy.tile(A, reps)</syntaxhighlight><blockquote>Construct an array by repeating A the number of times given by reps. If reps has length d, the result will have dimension of max(d, A.ndim). If A.ndim < d, A is promoted to be d-dimensional by prepending new axes. So a shape (3,)...") Tag: Visual edit
- 12:43, 17 October 2025 Davrot talk contribs created page Piecewise (Created page with "== Top == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.piecewise.html numpy.piecewise] == <syntaxhighlight lang="python">numpy.piecewise(x, condlist, funclist, *args, **kw)</syntaxhighlight><blockquote>Evaluate a piecewise-defined function. Given a set of conditions and corresponding functions, evaluate each function on the input data wherever its condition is true.</blockquote><syntaxhighlight la...") Tag: Visual edit
- 12:43, 17 October 2025 Davrot talk contribs created page Where (Created page with "== The goal == '''where''' allows to modifiy or combine matricies based on a given condition. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.where.html numpy.where] == <syntaxhighlight lang="python">numpy.where(condition, [x, y, ]/)</syntaxhighlight><blockquote>Return elements chosen from x or y depending on condition.</blockquote><blockquote>'''condition''': array_like, bool Where True, yield x, ot...") Tag: Visual edit
- 12:42, 17 October 2025 Davrot talk contribs created page Unique (Created page with "== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.unique.html numpy.unique] == <syntaxhighlight lang="python">numpy.unique(ar, return_index=False, return_inverse=False, return_counts=False, axis=None, *, equal_nan=True)</syntaxhighlight><blockquote>Find the unique elements of an array. Returns the sorted unique elements of an array. There are three optional outputs in addition to the uni...") Tag: Visual edit
- 12:41, 17 October 2025 Davrot talk contribs created page Merging matrices (Created page with "== Top == Questions to [mailto:davrot@uni-bremen.de David Rotermund] Choose vs select: * Choose: One Matrix with integer values 0,…N-1 * Select: N binary matrices == [https://numpy.org/doc/stable/reference/generated/numpy.choose.html#numpy-choose numpy.choose] == <syntaxhighlight lang="python">numpy.choose(a, choices, out=None, mode='raise')</syntaxhighlight><blockquote>Construct an array from an index array and a list of arrays to choose from. First of all,...") Tag: Visual edit
- 12:39, 17 October 2025 Davrot talk contribs created page Concatenate Matrices and arrays (Created page with "== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == numpy.concatenate == <syntaxhighlight lang="python">numpy.concatenate((a1, a2, ...), axis=0, out=None, dtype=None, casting="same_kind")</syntaxhighlight><blockquote>Join a sequence of arrays along an existing axis.</blockquote><syntaxhighlight lang="python">import numpy as np a = np.arange(0, 5) print(a) # -> [0 1 2 3 4] print(a.shape) # -> (5,) b = np.arange(0, 8) print(b) # -> [0 1 2 3 4...") Tag: Visual edit
- 12:37, 17 October 2025 Davrot talk contribs created page Slices and Views (Created page with "== The goal == Sometimes we want to use or see only a part of the matrix. This can be done via slices and views Questions to [mailto:davrot@uni-bremen.de David Rotermund] == 1-d slices == We assume N as the number of elements and 1d: * A valid index starts at '''0''' and runs until N-1 * [start:stop:step] start = 1, stop=N, step=1 -> this results in the sequence 1,2,3,…,(N-1) * [start:stop:1] can be shortened to [start:stop] * [0:stop] can be shortene...") Tag: Visual edit
- 12:36, 17 October 2025 Davrot talk contribs created page Reshape and flatten (Created page with "== The goal == Sometimes you have to change the shape of a matrix. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.reshape.html Reshape] == <syntaxhighlight lang="python">numpy.reshape(a, newshape, order='C')</syntaxhighlight><blockquote>Gives a new shape to an array without changing its data.</blockquote><blockquote>'''a''': array_like Array to be reshaped.</blockquote><blockquote>'''newshape''': in...") Tag: Visual edit
- 12:36, 17 October 2025 Davrot talk contribs created page File:98khj image0.png
- 12:36, 17 October 2025 Davrot talk contribs uploaded File:98khj image0.png
- 12:34, 17 October 2025 Davrot talk contribs created page Save and load (Created page with "== The goal == Let’s [https://numpy.org/doc/stable/reference/routines.io.html save and load data under numpy]. This can be more complicated than expected. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.save.html np.save] and [https://numpy.org/doc/stable/reference/generated/numpy.load.html np.load] == A normal np.save and np.load cycle may look like this:<syntaxhighlight lang="python">import numpy...") Tag: Visual edit
- 12:33, 17 October 2025 Davrot talk contribs created page New matrix (Created page with "== The goal == Making a new matrix… Questions to [mailto:davrot@uni-bremen.de David Rotermund] Using '''import numpy as np''' is the standard. == Simple example – new [https://numpy.org/doc/stable/reference/generated/numpy.zeros.html np.zeros()] == Define the size of your new matrix with a tuple, e.g.<syntaxhighlight lang="python">M = numpy.zeros((DIM_0, DIM_1, DIM_2, …))</syntaxhighlight> === 1d === <syntaxhighlight lang="python">import numpy as np M = np....") Tag: Visual edit
- 12:29, 17 October 2025 Davrot talk contribs created page Convert other data into numpy arrays e.g. asarray (Created page with "== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.asarray.html numpy.asarray] == <syntaxhighlight lang="python">numpy.asarray(a, dtype=None, order=None, *, like=None)</syntaxhighlight>The importance of '''asarray''':<blockquote>Convert the input to an array.</blockquote><syntaxhighlight lang="python">import numpy as np a_list = [[1, 2], [3, 4]] a_np = np.asarray(a_list) w = np.asarray(...") Tag: Visual edit
- 17:50, 16 October 2025 Davrot talk contribs created page Making a matrix from numerical ranges (Created page with "== The goal == Making a new matrix… Questions to [mailto:davrot@uni-bremen.de David Rotermund] Using '''import numpy as np''' is the standard. == Simple example – new [https://numpy.org/doc/stable/reference/generated/numpy.zeros.html np.zeros()] == Define the size of your new matrix with a tuple, e.g.<syntaxhighlight lang="python">M = numpy.zeros((DIM_0, DIM_1, DIM_2, …))</syntaxhighlight> === 1d === <syntaxhighlight lang="python">import numpy as np M = np....") Tag: Visual edit
- 17:49, 16 October 2025 Davrot talk contribs created page File:Broadcasting 4.png
- 17:49, 16 October 2025 Davrot talk contribs uploaded File:Broadcasting 4.png
- 17:48, 16 October 2025 Davrot talk contribs created page File:Broadcasting 3.png
- 17:48, 16 October 2025 Davrot talk contribs uploaded File:Broadcasting 3.png
- 17:48, 16 October 2025 Davrot talk contribs created page File:Broadcasting 2.png
- 17:48, 16 October 2025 Davrot talk contribs uploaded File:Broadcasting 2.png
- 17:48, 16 October 2025 Davrot talk contribs created page File:Broadcasting 1.png
- 17:48, 16 October 2025 Davrot talk contribs uploaded File:Broadcasting 1.png
- 17:48, 16 October 2025 Davrot talk contribs created page Broadcasting: Automatic adaption of dimensions (Created page with "== The goal == Broadcasting: Automatic adaption of dimensions Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/devdocs/user/basics.broadcasting.html General broadcasting rules] == <blockquote>When operating on two arrays, NumPy compares their shapes element-wise. It starts with the trailing (i.e. '''''rightmost''''') dimension and works its way left. '''Two dimensions are compatible when''' * '''they are equal''', or * '''one of them is...") Tag: Visual edit
- 16:06, 16 October 2025 Davrot talk contribs created page Dimensions and shape (Created page with "== The goal == Matrices have dimensions. But how to add and remove extra dimensions (i.e. dimensions with length 1)? Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.ndarray.shape.html numpy.ndarray.shape] == <syntaxhighlight lang="python">ndarray.shape</syntaxhighlight><blockquote>Tuple of array dimensions. The shape property is usually used to get the current shape of an array, but may also be used...") Tag: Visual edit
- 16:05, 16 October 2025 Davrot talk contribs created page Set printoptions (Created page with " == Top == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://numpy.org/doc/stable/reference/generated/numpy.set_printoptions.html numpy.set_printoptions] == <syntaxhighlight lang="python">numpy.set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, suppress=None, nanstr=None, infstr=None, formatter=None, sign=None, floatmode=None, *, legacy=None)[source]</syntaxhighlight><blockquote>Set printing options.</blockquote><syntax...") Tag: Visual edit
- 16:04, 16 October 2025 Davrot talk contribs created page The N-dimensional array (ndarray) (Created page with " == The goal == Class has a very important job as a core container type in Python. It is really hard to find a good overview how to use them in a good practice manner. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Chaining of (ndarray) methods == <syntaxhighlight lang="python">import numpy as np a = np.ones((3, 3)) b = a.mean(axis=1).max() print(b) # -> 1.0</syntaxhighlight> == [https://numpy.org/doc/stable/reference/generated/numpy.ndarray.fill.html n...") Tag: Visual edit
- 15:47, 16 October 2025 Davrot talk contribs created page Collection of distinct hashable objects -- set and frozenset (Created page with " == Top == Questions to [mailto:davrot@uni-bremen.de David Rotermund] '''This is an optional topic!''' = [https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset Set Types — set, frozenset] = <blockquote>A set object is an unordered collection of distinct hashable objects. Common uses include membership testing, removing duplicates from a sequence, and computing mathematical operations such as intersection, union, difference, and symmetric difference....") Tag: Visual edit
- 15:32, 16 October 2025 Davrot talk contribs created page Python Scopes and Namespaces (Created page with " == The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] Shortened quotes from https://docs.python.org/3/tutorial/classes.html == [https://docs.python.org/3/tutorial/classes.html#scopes-and-namespaces-example Scopes and Namespaces Example] == <blockquote>This is an example demonstrating how to reference the different scopes and namespaces, and how [https://docs.python.org/3/reference/simple_stmts.html#global global] and [https://docs.python.org/3/refe...") Tag: Visual edit
- 15:25, 16 October 2025 Davrot talk contribs created page Logging (Created page with " == The goal == We want to log either or onto the screen or file. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://docs.python.org/3/library/logging.html#logging.getLogger logging.getLogger] == <syntaxhighlight lang="python">logging.getLogger(name=None)</syntaxhighlight><blockquote>Return a logger with the specified name or, if name is None, return a logger which is the root logger of the hierarchy. If specified, the name is typically a dot-separa...") Tag: Visual edit
- 15:24, 16 October 2025 Davrot talk contribs created page ProcessPoolExecutor: A fast way to implement multiprocessing (Created page with " == The goal == A fast way (measured in source code length) for multi-processing a function. Is it the best way? No, but it is easily accessable. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == An example == We want to run 4 processes (number_of_cpu_processes = 4) at the same time. The first step is to get rid of most of the arguments of the function function_a. We use [https://docs.python.org/3/library/functools.html#functools.partial functools.partial]...") Tag: Visual edit