Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
numpy
- Page 1
Re: NumPy and Python list
Programming
5 Years Ago
by karansingh
NumPy
, a Python package, has made its place in the world … object along with a set of advanced functions. Yes, a
NumPy
array is better than a Python list. This is in…. 4.It is easier to read and write items with
NumPy
.
NumPy vstack question
Programming
Software Development
12 Years Ago
by fatalaccidents
…= f1['Geometry'] nodes = geo['orig_node_number'] orig_nodes =
numpy
.array(nodes['0']) local_hot_list =
numpy
.column_stack((orig_nodes,press_day,temp_day)) print 'File ' + local_files…5 local_hot_list's go into one stack like complete_hot_lists =
numpy
.vstack(h_list1, h_list2, h_list3, h_list4, h_list5) I …
Re: NumPy vstack question
Programming
Software Development
12 Years Ago
by Gribouillis
…['Geometry'] nodes = geo['orig_node_number'] orig_nodes =
numpy
.array(nodes['0']) return
numpy
.column_stack((orig_nodes,press_day,temp_day)) complete_hot_list =
numpy
.vstack(tuple(local_hot_list(name, day_to_extract) for…
Numpy loadtxt with string data
Programming
Software Development
13 Years Ago
by hughesadam_87
…that I'm trying to store in a
numpy
array. avi_05MSalt00001.txt 2012 Feb 07 20:… (usec) 300 10 I've defined the following
numpy
datatype: [CODE]timefile_dtype=
numpy
.dtype([ ('filename', file), ('year', int), ('…, '', 50000, '', 300, 10) Is it possible for
numpy
to store these string variables? If so, am I doing…
Re: Numpy loadtxt with string data
Programming
Software Development
13 Years Ago
by Gribouillis
…, otherwise the length defaults to zero. [code=python] import
numpy
timefile_dtype=
numpy
.dtype([ ('filename', file), ('year', int), ('month', str…('unit', str, 25), ('avg', int), ('boxcar', int), ]) a =
numpy
.zeros((1,), dtype=timefile_dtype) x = a[0] x['filename'] = "…
NumPy hypergeometric distribution problem
Programming
Software Development
15 Years Ago
by justaguy101
Hi guys! I have a problem calling the
numpy
.random.hypergeometric function with certain values. It …is Vista, Python version 2.6 and the latest
NumPy
version(and SciPy). Any idea what causes this? …Here's an example: [CODE] from
numpy
.random import hypergeometric print hypergeometric(10000, 10000, 10000) #Works…
Numpy bit concatenation
Programming
Software Development
13 Years Ago
by Niner710
Hi, I created a
numpy
matrix(1 row, 3 cols) with the following values [4 … of [4 6 8] I would want to have a
numpy
matrix of just 1 entry [010001101000]. I would like each… a 4 digit binary number. I looked at reshape for
numpy
but am still unsure how to do this? Would appreciate…
Re: Numpy bit concatenation
Programming
Software Development
13 Years Ago
by Niner710
… sense. Now, what if I have a
numpy
array as follows. [CODE] m =
numpy
.array([0xfe,0xff,0xf7,0xff,0x65,0xef,0xcc…,0xff]) [/CODE] I want to be able to converge this
numpy
array into one entry. So I would like to have…
Re: NumPy hypergeometric distribution problem
Programming
Software Development
15 Years Ago
by vegaseat
… came up with these results ... [code]#
numpy
.random.hypergeometric(ngood, nbad, nsample, size=None) import
numpy
as np # these work fine print…
Re: Numpy bit concatenation
Programming
Software Development
13 Years Ago
by TrustyTony
[CODE]>>> import
numpy
>>> m =
numpy
.array([4, 6, 8]) >>> m array([4, 6, 8]) >>> print m[-1]+16*m[-2]+16**2*m[-3] 1128 >>> sum(m*[16**2, 16, 1]) 1128 >>> bin(1128) '0b10001101000' >>> [/CODE]
Numpy array 2d plotting
Programming
Software Development
15 Years Ago
by bol0gna
… numbers in each file to create a 2d plot using
numpy
. I've got a decent start, just am stuck on… to plot. [CODE] import os # for file handling functions import
numpy
as np # for array/matrix processing import matplotlib.pyplot as…
numpy array rows and columns
Programming
Software Development
15 Years Ago
by Chromana
Hey. I'm importing an array in a text file via [icode]array=
numpy
.loadtxt("testdata.txt")[/icode]. Is there an easy way to count the number of rows and columns? Maybe something like [icode]x=
numpy
.countrow(array)[/icode]? I've had a look around and couldn't find anything suitable. Thanks, Alex
Re: numpy array rows and columns
Programming
Software Development
15 Years Ago
by vegaseat
Use
numpy
shape ... [code]import
numpy
as np # create a 3 by 5 array of integer …
Tricky Numpy Vectorize Question
Programming
Software Development
14 Years Ago
by prodigenius
numpy
.vectorize takes a function f:a->b and turns … as an ndarray or list. For example: [CODE=python] import
numpy
as np def f(x): return np.array([1,1…
numpy + MA, problem with min and max on masked arrays
Programming
Software Development
17 Years Ago
by petr2008
Hi, I am using Python 2.4.4 and: from
numpy
import * from MA import * I am using masked data in …
numpy for python3?
Programming
Software Development
15 Years Ago
by daviddoria
I'm just starting python and it seemed reasonable to go ahead and learn the new version. I read that
numpy
wont be available for python3 until at least 2010. All I need is a basic "vector", "matrix", and some basic functions like matrix/vector multiplication. Is anything like this available for python3? Thanks, Dave
Numpy randn() sampling in a range of 1 and -1
Programming
Software Development
14 Years Ago
by pythonbegin
Hi All I have a query about
Numpy
randn() function to generate random samples from standard normal distribution. …
Re: Numpy randn() sampling in a range of 1 and -1
Programming
Software Development
14 Years Ago
by pythonbegin
…. [QUOTE=pythonbegin;1541978]Hi All I have a query about
Numpy
randn() function to generate random samples from standard normal distribution…
Re: Numpy randn() sampling in a range of 1 and -1
Programming
Software Development
14 Years Ago
by Gribouillis
…, 1.0] like this [code=python] sigma = 0.1 a =
numpy
.clip(X + sigma * randn(100, 20), -1.0, 1.0…
Re: Numpy randn() sampling in a range of 1 and -1
Programming
Software Development
14 Years Ago
by pythonbegin
…, 1.0] like this [code=python] sigma = 0.1 a =
numpy
.clip(X + sigma * randn(100, 20), -1.0, 1.0…
Re: Numpy randn() sampling in a range of 1 and -1
Programming
Software Development
14 Years Ago
by Gribouillis
… from log normal distribution.[/QUOTE] I suppose so. Write [icode]
numpy
.random.lognormal(mean, sigma, (100,20))[/icode]. But can you…
Numpy array creation
Programming
Software Development
13 Years Ago
by hughesadam_87
Hey guys, I have a simple
numpy
datatype: [CODE]spec_dtype = np.dtype([ ('wavelength', float), ('intensity', float) ])[/CODE] …
Re: Numpy array creation
Programming
Software Development
13 Years Ago
by TrustyTony
How about simply ziping the lists together: [CODE]import
numpy
as np spec_dtype = np.dtype([ ('wavelength', float), ('intensity', float) ]) wavelengths=[300.00, 200.00, 100.00] intensities=[23, 32, 43] mydata = np.array(zip(wavelengths, intensities), dtype=spec_dtype) print(mydata)[/CODE]
NumPy and Python list
Programming
5 Years Ago
by Abhays01
Is
NumPy
is better than Python list?
Re: Convert python list to numpy array.
Programming
Software Development
16 Years Ago
by sneekula
Numpy
handles only numeric arrays, not object arrays. I think VPython actually uses
numpy
/numeric internally.
Re: Python 3.3 and Numpy
Programming
Software Development
12 Years Ago
by vegaseat
numpy
-MKL-1.6.2.win32-py3.3.exe can be found at the Gohlke site
Re: Loan calculation using Python module numpy
Programming
Software Development
11 Years Ago
by HiHe
Numpy
is not only fast, but in this case simple to use.
Re: Tricky Numpy Vectorize Question
Programming
Software Development
14 Years Ago
by prodigenius
No, it is not solved. Your solution has the exact same problem is my line 7 - it gives a
numpy
object array, not a
numpy
float array. Did you test it? repr(g(a)) == 'array([[ 0. 0. 0. 0. 0.], [ 1. 1. 1. 1. 1.], [ 2. 2. 2. 2. 2.],[ 3. 3. 3. 3. 3.]], dtype=object)'
Re: Tricky Numpy Vectorize Question
Programming
Software Development
14 Years Ago
by TrustyTony
[CODE]import
numpy
as np def f(x): return np.array([1,1,1,1,1], dtype=np.float32) * x g = np.vectorize(f, otypes=[np.ndarray]) a = np.arange(4) print(a) print repr(g(a)) [/CODE]
Re: Tricky Numpy Vectorize Question
Programming
Software Development
14 Years Ago
by TrustyTony
Why not without vectorize, then? [CODE]import
numpy
as np def f(x): return np.array([1.0,…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC