<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mscneuro.neuro.uni-bremen.de/index.php?action=history&amp;feed=atom&amp;title=Convert_other_data_into_numpy_arrays_e.g._asarray</id>
	<title>Convert other data into numpy arrays e.g. asarray - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mscneuro.neuro.uni-bremen.de/index.php?action=history&amp;feed=atom&amp;title=Convert_other_data_into_numpy_arrays_e.g._asarray"/>
	<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Convert_other_data_into_numpy_arrays_e.g._asarray&amp;action=history"/>
	<updated>2026-06-02T10:55:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=Convert_other_data_into_numpy_arrays_e.g._asarray&amp;diff=350&amp;oldid=prev</id>
		<title>Davrot at 16:35, 17 October 2025</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Convert_other_data_into_numpy_arrays_e.g._asarray&amp;diff=350&amp;oldid=prev"/>
		<updated>2025-10-17T16:35:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:35, 17 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== The goal ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-180:rev-350:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=Convert_other_data_into_numpy_arrays_e.g._asarray&amp;diff=180&amp;oldid=prev</id>
		<title>Davrot: Created page with &quot;== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund]  == [https://numpy.org/doc/stable/reference/generated/numpy.asarray.html numpy.asarray] == &lt;syntaxhighlight lang=&quot;python&quot;&gt;numpy.asarray(a, dtype=None, order=None, *, like=None)&lt;/syntaxhighlight&gt;The importance of &#039;&#039;&#039;asarray&#039;&#039;&#039;:&lt;blockquote&gt;Convert the input to an array.&lt;/blockquote&gt;&lt;syntaxhighlight lang=&quot;python&quot;&gt;import numpy as np   a_list = [[1, 2], [3, 4]] a_np = np.asarray(a_list)  w = np.asarray(...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=Convert_other_data_into_numpy_arrays_e.g._asarray&amp;diff=180&amp;oldid=prev"/>
		<updated>2025-10-17T12:29:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund]  == [https://numpy.org/doc/stable/reference/generated/numpy.asarray.html numpy.asarray] == &amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;numpy.asarray(a, dtype=None, order=None, *, like=None)&amp;lt;/syntaxhighlight&amp;gt;The importance of &amp;#039;&amp;#039;&amp;#039;asarray&amp;#039;&amp;#039;&amp;#039;:&amp;lt;blockquote&amp;gt;Convert the input to an array.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np   a_list = [[1, 2], [3, 4]] a_np = np.asarray(a_list)  w = np.asarray(...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== The goal ==&lt;br /&gt;
Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;br /&gt;
&lt;br /&gt;
== [https://numpy.org/doc/stable/reference/generated/numpy.asarray.html numpy.asarray] ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;numpy.asarray(a, dtype=None, order=None, *, like=None)&amp;lt;/syntaxhighlight&amp;gt;The importance of &amp;#039;&amp;#039;&amp;#039;asarray&amp;#039;&amp;#039;&amp;#039;:&amp;lt;blockquote&amp;gt;Convert the input to an array.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
a_list = [[1, 2], [3, 4]]&lt;br /&gt;
a_np = np.asarray(a_list)&lt;br /&gt;
&lt;br /&gt;
w = np.asarray(1)&lt;br /&gt;
&lt;br /&gt;
print(w.sum())  # -&amp;gt; 1&lt;br /&gt;
print(a_np.sum())  # -&amp;gt; 10&lt;br /&gt;
print(a_np &amp;gt; 2)&lt;br /&gt;
&lt;br /&gt;
print(1.sum()) # SyntaxError: invalid decimal literal&lt;br /&gt;
print(a_list.sum())  # AttributeError: &amp;#039;list&amp;#039; object has no attribute &amp;#039;sum&amp;#039;&lt;br /&gt;
print(a_list &amp;gt; 2) # TypeError: &amp;#039;&amp;gt;&amp;#039; not supported between instances of &amp;#039;list&amp;#039; and &amp;#039;int&amp;#039;&amp;lt;/syntaxhighlight&amp;gt;Output:&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;[[False False]&lt;br /&gt;
 [ True  True]]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [https://numpy.org/doc/stable/reference/generated/numpy.fromiter.html numpy.fromiter] ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This is an optional topic!&amp;#039;&amp;#039;&amp;#039;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;numpy.fromiter(iter, dtype, count=-1, *, like=None)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Create a new 1-dimensional array from an iterable object.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [https://numpy.org/doc/stable/reference/generated/numpy.fromfunction.html numpy.fromfunction] ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This is an optional topic!&amp;#039;&amp;#039;&amp;#039;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;numpy.fromfunction(function, shape, *, dtype=&amp;lt;class &amp;#039;float&amp;#039;&amp;gt;, like=None, **kwargs)[source]&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Construct an array by executing a function over each coordinate.&lt;br /&gt;
&lt;br /&gt;
The resulting array therefore has a value fn(x, y, z) at coordinate (x, y, z).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [https://numpy.org/doc/stable/reference/generated/numpy.array.html numpy.array] ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This is an optional topic!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Don’t confuse &amp;#039;&amp;#039;&amp;#039;asarray&amp;#039;&amp;#039;&amp;#039; with &amp;#039;&amp;#039;&amp;#039;array&amp;#039;&amp;#039;&amp;#039;. &amp;#039;&amp;#039;&amp;#039;array&amp;#039;&amp;#039;&amp;#039; can be used to put a numpy structure around data. &amp;#039;&amp;#039;&amp;#039;asarray&amp;#039;&amp;#039;&amp;#039; converts the data into a numpy array. (As far as I understand…). Thus normally you don’t need to touch &amp;#039;&amp;#039;&amp;#039;array&amp;#039;&amp;#039;&amp;#039;.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;numpy.array(object, dtype=None, *, copy=True, order=&amp;#039;K&amp;#039;, subok=False, ndmin=0, like=None)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Create an array.&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
</feed>