Numpy does not seem to allow fractional powers of negative numbers, even if the power would not result in a complex number. (I actually had this same problem earlier today, unrelatedly). One workaround is to use
np.sign(a) * (np.abs(a)) ** (1 / 3)
More Related Contents:
- difference between arrays in numpy
- value error in python script
- How to print the full NumPy array, without truncation?
- Rank items in an array using Python/NumPy, without sorting array twice
- Numpy array assignment with copy
- Repeating each element of a numpy array 5 times
- Bin elements per row – Vectorized 2D Bincount for NumPy
- Calculate weighted average using a pandas/dataframe
- How do I select elements of an array given condition?
- Comparing previous row values in Pandas DataFrame
- Numpy argsort – what is it doing?
- Ambiguity in Pandas Dataframe / Numpy Array “axis” definition
- How to create a numpy array of arbitrary length strings?
- Subsetting a 2D numpy array
- How to normalize a 2-dimensional numpy array in python less verbose?
- Counting unique values in a column in pandas dataframe like in Qlik?
- How to get a normal distribution within a range in numpy? [duplicate]
- Annotate Time Series plot in Matplotlib
- Removing elements from an array that are in another array
- How can I count the number of consecutive TRUEs in a DataFrame?
- check for identical rows in different numpy arrays
- read matlab v7.3 file into python list of numpy arrays via h5py
- Installing numpy on Docker Alpine
- How to center labels in histogram plot
- module ‘pandas’ has no attribute ‘read_csv
- Weighted random sample without replacement in python
- Add numpy array as column to Pandas data frame
- Fit mixture of two gaussian/normal distributions to a histogram from one set of data, python
- Why is NaN considered as a float?
- NumPy library ImportError: DLL load failed: The specified procedure could not be found