All Questions
Tagged with python-3.6 numpy
127 questions
0
votes
1
answer
205
views
Numpy loadtxt in python - except some colums
Is it possible in np.loadtxt to load all columns except the first one, or except some particular ones, please?
What does usecols = (0,) mean, please?
Is it possible to use sliders?
I have 55 columns, ...
0
votes
2
answers
526
views
Replace all off diagonal elements in numpy array
I have below numpy array
import numpy as np
np.identity(13)
Now I like to replace all off-diagonal elements with some other number, say 0.45.
Is there any direct method available to perform this?
0
votes
2
answers
2k
views
VCF file is missing mandatory header line ("#CHROM...")
I am getting an error when I am going to read a VCF file using scikit-allel library inside a docker image and os ubuntu 18.04. It shows that
raise RuntimeError('VCF file is missing mandatory header ...
0
votes
0
answers
378
views
AttributeError: 'list' object has no attribute 'reshape'. for big frames
this is my code. and i don't know what is the problem. the my goal is read more number frames and then convert them to array and finally split them to train and test data.
def read_frames(PATH, num1, ...
-3
votes
1
answer
1k
views
do numpy 1.19 work with python 3.6 and pandas 1.15 ? If not what version do I have to use? [duplicate]
The error I am facing is:
Unable to import module 'lambda_function': Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the ...
1
vote
1
answer
2k
views
Unable to install pandas=0.18.1 on Python3.6
I am trying to setup a legacy project using python 3.6.13 as a constraint. Though I am running into an issue trying to install pandas version 0.18.1
The log are as below:
Collecting numpy==1.11.1 (...
6
votes
5
answers
10k
views
Flask : 'Token' object has no attribute 'test' | render_template error
Code in Fake_News_Det.py :
from flask import Flask, render_template, request
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import PassiveAggressiveClassifier
...
8
votes
1
answer
4k
views
ModuleNotFoundError: No module named 'numpy.testing.decorators'
I really need some help, as I have gone through all the posts and nothing has worked. I get this error when importing gensim and not numpy (numpy is before and works fine). All I want to do is import ...
2
votes
1
answer
146
views
Fastest way to create a tilted/successively shifted matrix in numpy
I need to create a (w,N)-matrix that looks like this:
w//2............N-1,N-1
. \ N-1
. \ N-1
. \ N-1
1...............N-1,N-1
0...................N-1
00....
0
votes
2
answers
400
views
Conda package bug? binary incompatability
I'm working in a remote Jupyter notebook on a system where I don't have root access, or even a shell in which to make many adjustments. I can retrieve packages from Conda's archive and run functions ...
2
votes
1
answer
3k
views
Python abs() function failing on negative number
I'm working in python3.6 on linux and came across a pretty obvious failure of the abs() function. My variable x ended up as a very large negative number (possibly -inf), but the absolute value abs() ...
0
votes
2
answers
3k
views
ValueError: Wrong number of items passed 1, placement implies 2
I figured out both error ROC curve and running big datasets through multiprocessing. This process works fine but after 30 minutes, I suddenly get an error.
Multiprocessing Code Changed:
for i in range(...
0
votes
0
answers
142
views
Changed a numpy array of string to float but could not get its mean or sum due to unsupported operand type(s) for +: 'float' and 'str'
This is the array that I have which has dtype=object
>>> a
array([25.0, 0.0, 0.0, ..., 0.0, 83.3333, 0.0], dtype=object)
I tried using the astype method to convert the array but got an error:...
1
vote
0
answers
123
views
CVXOPT yields nan during robust least-squares
I'm trying to reproduce the example "robust least-squares" from the cvxopt documentation:
import numpy as np
import cvxopt
def robls(A, b, rho):
m, n = A.size
def F(x=None, z=None):
...
1
vote
1
answer
769
views
Pyinstaller exe fails to execute numpy operation when run from command prompt but works fine from the conda env in anaconda prompt
The exe generated using pyinstaller runs fine in the conda environment. However, when run via command prompt it runs only upto a point in the code. Using multiple print statements, I found that the ...