Python

Python is a dynamic, strongly typed, object-oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Two similar but incompatible versions of Python are in use (Python 2.7 or 3.x). For version-specific Python questions, please also use the [python-2.7] or [python-3.x] tags. When using a Python variant (Jython, Pypy, Iron-python, etc.) - please also tag the variant.

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
476 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
65 votes
5 answers
1.9K views
Can I detect if my code is running on cPython or Jython?

I'm working on a small django project that will be deployed in a servlet container later. But development

avatar
Denese
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
47 votes
2 answers
2.4K views
Jythonc missing

I just installed Jython 2.5.1. I want to convert my Python file into Java class file and it is instructed on t

avatar
Jeff
0 1 0 9
asked 07 September, 2021
49 votes
4 answers
2.2K views
Differences between Jython and Python

I know Jython converts Python code into Java byte code, but are there any syntax changes between the two? and

avatar
Tuan
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
62 votes
3 answers
2.1K views
How to read the last MB of a very large text file

I am trying to find a string near the end of a text file. The problem is that the text file can vary greatly i

avatar
Charis
0 1 0 9
asked 07 September, 2021
69 votes
2 answers
1.4K views
Pure python implementation of greenlet API

The greenlet package is used by gevent and eventlet for asynchronous IO. It is written as a C-extension and t

avatar
Elicia
0 1 0 9
asked 07 September, 2021
61 votes
4 answers
1.9K views
Does Jython have the GIL?

I was sure that it hasn't, but looking for a definite answer on the Interwebs left me in doubt. For examp

avatar
Nereida
0 1 0 9
asked 07 September, 2021
54 votes
3 answers
2.8K 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