If you’re looking for fast, you can use numpy:
>>> import numpy
>>> numpy.subtract((10, 10), (4, 4))
array([6, 6])
and if you want to keep it in a tuple:
>>> tuple(numpy.subtract((10, 10), (4, 4)))
(6, 6)
More Related Contents:
- Change sign of elements with an odd sum of indices
- How can I split a column of tuples in a Pandas dataframe?
- How to map numeric data into categories / bins in Pandas dataframe
- ImportError: numpy.core.multiarray failed to import
- Numpy – create matrix with rows of vector
- Implement MATLAB’s im2col ‘sliding’ in Python
- Installing Numpy on 64bit Windows 7 with Python 2.7.3 [closed]
- Convert list to tuple in Python
- Convert timedelta64[ns] column to seconds in Python Pandas DataFrame
- Numpy: Fix array with rows of different lengths by filling the empty elements with zeros
- What is the inverse function of zip in python? [duplicate]
- ImportError: cannot import name NUMPY_MKL
- RuntimeError: module compiled against API version a but this version of numpy is 9
- Improve Row Append Performance On Pandas DataFrames
- Screen Capture with OpenCV and Python-2.7
- Parse a Pandas column to Datetime when importing table from SQL database and filtering rows by date
- Understanding NumPy’s Convolve
- Python pickle protocol choice?
- ImportError: DLL load failed when importing Numpy installed in conda virtual environment
- Loading text file containing both float and string using numpy.loadtxt
- Python Pandas: remove entries based on the number of occurrences
- numpy.sum() giving strange results on large arrays
- How to implement Garbage Collection in Numpy
- Converting string to tuple without splitting characters
- How can the Euclidean distance be calculated with NumPy?
- Sorting arrays in NumPy by column
- Numpy matrix to array
- how to convert an RGB image to numpy array?
- sort eigenvalues and associated eigenvectors after using numpy.linalg.eig in python
- Good ways to “expand” a numpy ndarray?