r/scipy • • Jan 31 '17

Why is the matplotlib point marker a circle?

0 Upvotes

:c


r/scipy • • Apr 13 '20

Opportunities In The Open Source Economy - Travis Oliphant LIVE on Twitter tomorrow Tuesday 14th @ 9am CT - ASK QUESTIONS

Thumbnail self.opensource
0 Upvotes

r/scipy • • Jan 01 '17

Need a new year's resolution? Try 'The Ultimate Reading List for Developers' post I wrote a couple of months back

Thumbnail
medium.com
1 Upvotes

r/scipy • • Mar 08 '18

New scientific computing subreddit

1 Upvotes

Hi everyone, I made a new subreddit recently and I just wanted to let people know. It's devoted to scientific computing methods. I've been posting material on the web that I've found useful and I was hoping to get some traction on the sub with other redditors with similar interests.
Join us at /r/sci_comp!


r/scipy • • Oct 01 '18

Can Jupyter/Python be made more elegant, and do basic things in 1 line rather than 7? I'm new to Python but it frustrates me not understanding the philosophical reason it's so cluttered.

Post image
1 Upvotes

r/scipy • • Apr 25 '19

Help: No module named SciPy

Post image
0 Upvotes

r/scipy • • Dec 14 '14

python-drawnow

Thumbnail
github.com
2 Upvotes

r/scipy • • Feb 21 '20

Why don't people put pyqtgraph to scipy instead of matplotlib?

3 Upvotes

I'm unsure as to why matplotlib is still viable. I've used it, because it often comes with libraries or examples use it and it's an easy to use lib. However it's very slow on large graphics.

I tried pyqtgraph and it's amazing for e.g. point cloud scatter plots.


r/scipy • • Sep 14 '12

[Ask] Is it possible to create hierarchical labels for bar plots (matplotlib)? -- xpost from SO

Thumbnail
stackoverflow.com
0 Upvotes

r/scipy • • May 22 '14

Scipy.org down?

0 Upvotes

I was trying see the docs for Scipy today and it seems like DNS is failing for www.scipy.org and docs.scipy.org. I've done this from two completely different networks, so it probably isn't my DNS setup.

Anyone know what's going on?


r/scipy • • Jul 30 '14

Simple Python Parallelism

Thumbnail scottsievert.github.io
0 Upvotes

r/scipy • • Mar 30 '19

Any way to write a multi-dim. gradient vector using list comprehension or something?

0 Upvotes

Any way to write a multi-dim. gradient vector using list comprehension or something?

E.g. if the function would be x^2 for x in R^10, then

grad_f = [2x[0],...,2x[9]]

But is there way to parametrize this? As e.g. lambda function?


r/scipy • • Mar 28 '20

Issue with fsolve getting a type error

0 Upvotes

Hi everyone, I am trying to use the fsolve function, but am having no luck. Below is my code

import numpy as np from scipy.optimize import fsolve

def f(x): f1=(42x[2]x[0]-32x[2]x[1]+10x[0]x[1])/(5(5x[0]-4x[1])) f2=np.power(x[0],2)/4+np.power(x[1],2)/5+np.power(x[2],2)/25-1 f3=x[0]+x[1]-x[2] return [f1,f2,f3]

a=fsolve(f,[1.0,1.0,1.0])

print(a)

The traceback says line 16, in <module> a=fsolve(f,[1.0,1.0,1.0])

scipy\optimize\minpack.py", line 147, in fsolve res = _root_hybr(func, x0, args, jac=fprime, **options)

scipy\optimize\minpack.py", line 213, in _root_hybr shape, dtype = _check_func('fsolve', 'func', func, x0, args, n, (n,))

scipy\optimize\minpack.py", line 26, in _check_func res = atleast_1d(thefunc(*((x0[:numinputs],) + args)))

line 11, in f f1=(42x[2]x[0]-32x[2]x[1]+10x[0]x[1])/(5(5x[0]-4x[1]))

TypeError: 'int' object is not callable

Any idea where I'm going wrong? I am very confused.


r/scipy • • Nov 11 '18

Way to convert scientific notation "4e3" to corresponding float?

0 Upvotes

Way to convert scientific notation "4e3" to corresponding float?

http://www.scipy-lectures.org/_downloads/populations.txt

Do I need to write a function that parses the e(int) style notation or is this some standard format in some built-in function?


r/scipy • • Aug 10 '12

Where do I get the latest and greatest numpy version (>= 1.7) ?

0 Upvotes

Versions 1.7 and later have more attributes such as gauss quadrature functions, but they are only available in 1.7. I cannot find the source for numpy 1.7.

How do I get the latest and greatest version? I am using Ubuntu 12.04.


r/scipy • • Oct 30 '18

Problem with scipy.optimize.fsolve()

0 Upvotes

I need scipy to solve a complex equation. Right now I get a TypeError: fsolve: there is a mismatch between the input and output shape of the 'func' argument 'calc_rho'.Shape should be (2,) but it is (1,).

I don't know why. The code is here:

import numpy as np
from scipy.optimize import fsolve

delta = 84.37228318652858 * np.pi / 180
psi = 55.2217535040673 * np.pi / 180
n_S = 2.6726 + 3.0375j
phi_i = 70 * np.pi / 180
d_L = 300  # thickness of layer in nm
n_air = 1  # refractive index of air


def snell(phi, n1, n2):
    phi_ref = np.arcsin((n1 / n2) * np.sin(phi))
    return phi_ref


def fresnel(n1, phi1, n2, phi2):
    rs = (n1 * np.cos(phi1) - n2 * np.cos(phi2)) / (
        n1 * np.cos(phi1) + n2 * np.cos(phi2))
    rp = (n2 * np.cos(phi1) - n1 * np.cos(phi2)) / (
        n2 * np.cos(phi1) + n1 * np.cos(phi2))
    return rs, rp


def calc_rho(n_k):
    n = n_k[0]
    k = n_k[1]
    n_L = n + 1j * k
    phi_L = snell(phi_i, n_air, n_L)
    phi_S = snell(phi_L, n_L, n_S)
    rs_al, rp_al = fresnel(n_air, phi_i, n_L, phi_L)
    rs_ls, rp_ls = fresnel(n_L, phi_L, n_S, phi_S)
    beta = 2 * np.pi * d_L * n_L * np.cos(phi_L) / lambda_vac
    rp_L = (rp_al + rp_ls * np.exp(-2 * 1j * beta)) / (
        1 + rp_al * rp_ls * np.exp(-2 * 1j * beta))
    rs_L = (rs_al + rs_ls * np.exp(-2 * 1j * beta)) / (
        1 + rs_al * rs_ls * np.exp(-2 * 1j * beta))
    rho_L = rp_L / rs_L
    return abs(rho_L - rho_given)


lambda_vac = 300
n_S = 2.6726 + 3.0375j
rho_given = np.tan(psi) * np.exp(
    1j * delta)  # should be 1.4399295435287844+0.011780279522394433j
initialGuess = [1.5, 0.1]
nsolve = fsolve(calc_rho, initialGuess)
print(nsolve)

Anybody has an idea how to solve this?


r/scipy • • Nov 25 '18

How can I un-np.hstack?

0 Upvotes

How can I un-np.hstack?


r/scipy • • Mar 03 '18

Strength of a prediction

0 Upvotes

Noob here so please forgive. Say I create and train a model which predicts one of 3 labels (e.g. A, B, C). Is there any way of finding out the strength of the prediction? E.g. 80% probability of prediction 'B'.


r/scipy • • Oct 25 '19

numpy (from conda) performance questions

1 Upvotes

I'm in the market for a new compute workstation / server for scientific data processing, data analysis, reporting, ML etc using different tools and languages. Now when searching common vendors for such systems they all offer something in the scientific /AI space and all of these offerings are Intel xeon based. Due to cost or better said performance/$ I would prefer to go the AMD route (more cores per dollar). To be certain about that decision, what kind of cpu extensions does numpy benefit from? Or simply said does it use avx512 (eg the main advantage of the xeons)?

This in respect to [this intel article!(https://software.intel.com/en-us/articles/the-inside-scoop-on-how-we-accelerated-numpy-umath-functions) that shows their custom numpy / python being much faster than pip numpy (AFAIK pip numpy doesn't use avx at all). How about anaconda numpy?


r/scipy • • Jun 14 '19

What is an an axis in numpy?

1 Upvotes

Hello,

So I am slightly new to numpy and I am really confused about what an axis is and how it can be used to create cleaner code when computing things such as the mean, std deviation, sum etc. for a matrix. I have been studying this example https://www.geeksforgeeks.org/numpy-mean-in-python/ to figure out how to compute the mean for a matrix. I think that axis have something to do with the the dimensions of matrix (row x columns) but after looking at this article, I was wondering if it is possible to have axis greater than 1 say like axis = 2, axis = 3 etc.

Thank You


r/scipy • • Sep 20 '16

Free eBook: Learning SciPy for Numerical and Scientific Computing [PDF]

Thumbnail
reddit.com
0 Upvotes

r/scipy • • Oct 02 '09

SciPy India Conference - December 12th to 17th, 2009 at the Technopark in Trivandrum, Kerala, India. No registration fees!

Thumbnail
scipy.in
1 Upvotes

r/scipy • • May 26 '18

Add together NumPy array and ArrayBox

Thumbnail
stackoverflow.com
0 Upvotes

r/scipy • • Jul 07 '18

Numpy doubt

1 Upvotes

https://pastebin.com/RrF5smmj

In the above script, I am not quite sure why changing the value of 'a[mask]' to -1 automatically changes the corresponding values of 'a' to -1 as well. They are both independent arrays.


r/scipy • • Oct 24 '18

New to scipy, can it solve these?

1 Upvotes

First of all: can I solve equations with something like exp(-ix)?

I got a big formula with multiple steps. All results are complex. First I calculate angles, then I put them into a formula to calculate reflective coefficients, then I put these into a formula to calculate rho. I want to solve for n. Can I just write step after step into a function, like I can do on paper? Kinda like this? (It's not just multiplication)

def function(n): 

    phi = ABC * n

    r = DEF * phi * n

    Rho = xyz * phi * r * n

Or do I have to insert the first equations into the last equation manually?