Tag: c

56 votes
7 answers
1.2K views
How to add a new row to an empty numpy array

Using standard Python arrays, I can do the following: arr = [] arr.append([1,2,3]) arr.append([4,5,6]) # arr

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
43 votes
7 answers
2.6K views
How to do exponential and logarithmic curve fitting in Python? I found only polynomial fitting

I have a set of data and I want to compare which line describes it best (polynomials of different orders, expo

avatar
Luis
0 1 0 9
asked 07 September, 2021
54 votes
11 answers
1.5K views
Is there a library function for Root mean square error (RMSE) in python?

I know I could implement a root mean squared error function like this: def rmse(predictions, targets): re

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
62 votes
15 answers
1.6K views
Installing SciPy with pip

It is possible to install NumPy with pip using pip install numpy. Is there a similar possibility with SciPy?

avatar
Jeff
0 1 0 9
asked 07 September, 2021
54 votes
17 answers
3.1K views
Calculating Pearson correlation and significance in Python

I am looking for a function that takes as input two lists, and returns the Pearson correlation, and the signif

avatar
Percy
0 1 0 9
asked 07 September, 2021
56 votes
28 answers
1.7K views
Moving average or running mean

Is there a SciPy function or NumPy function or module for Python that calculates the running mean of a 1D arra

avatar
Yolando
0 1 0 9
asked 07 September, 2021
62 votes
10 answers
2.7K views
How to smooth a curve in the right way?

Lets assume we have a dataset which might be given approximately by import numpy as np x = np.linspace(0,2*np

avatar
Bryan
0 1 0 9
asked 07 September, 2021
58 votes
9 answers
475 views
Does Conda replace the need for virtualenv?

I recently discovered Conda after I was having trouble installing SciPy, specifically on a Heroku app that I a

avatar
Percy
0 1 0 9
asked 07 September, 2021
47 votes
29 answers
1.7K views
Import Error: No module named numpy

I have a very similar question to this question, but still one step behind. I have only one version of Python

avatar
Fabian
0 1 0 9
asked 07 September, 2021
60 votes
8 answers
1.2K views
Relationship between SciPy and NumPy

SciPy appears to provide most (but not all [1]) of NumPy's functions in its own namespace. In other words

avatar
Tuan
0 1 0 9
asked 07 September, 2021
59 votes
12 answers
2.3K views
Read .mat files in Python

Is it possible to read binary MATLAB .mat files in Python? I've seen that SciPy has alleged support for

avatar
Majorie
0 1 0 9
asked 07 September, 2021
66 votes
2 answers
452 views
Packaging a Jython program in an executable jar

I am trying to package a jython program into an executable jar which the user can simply double-click to run w

avatar
Joseph
0 1 0 9
asked 07 September, 2021
53 votes
1 answers
762 views
Clojure Jython interop

I was wondering if anyone has tried somehow calling Jython functions from within Clojure, and how you went abo

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
49 votes
5 answers
2.8K views
fast-ish python/jython IPC?

All I want to do is make some RPC calls over sockets. I have a server that does backendish stuff running jytho

avatar
Nereida
0 1 0 9
asked 07 September, 2021
52 votes
2 answers
2.2K views
Why does this Jython loop fail after a single run?

I've got the following code: public static String getVersion() { PythonInterpreter interpreter = ne

avatar
Clarice
0 1 0 9
asked 07 September, 2021
50 votes
1 answers
1.6K views
Interoperability of Scala and Jython

I would think that since they both run on the JVM, Scala and Jython could be used together. How well do they i

avatar
Sydney
0 1 0 9
asked 07 September, 2021
62 votes
2 answers
1.6K views
Jython CLASSPATH, sys.path and JDBC drivers

How can I add JDBC drivers at runtime to Jython? Using CLASSPATH works, but using sys.path doesn't work w

avatar
Hilario
0 1 0 9
asked 07 September, 2021
62 votes
6 answers
1.1K views
What are some strategies to write python code that works in CPython, Jython and IronPython

Having tries to target two of these environments at the same time I can safely say the if you have to use a da

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
54 votes
5 answers
1.6K views
Using NumPy and Cpython with Jython

I must use a commercial Java library, and would like to do it from Python. Jython is robust and I am fine with

avatar
Nereida
0 1 0 9
asked 07 September, 2021
54 votes
3 answers
2.7K views
How to catch an exception in python and get a reference to the exception, WITHOUT knowing the type?

I'm wondering how I can catch any raised object (i.e. a type that does not extend Exception), and still g

avatar
Vi
0 1 0 9
asked 07 September, 2021