皇冠hg0088代理网址

Questions tagged [python]

Python is a multi-paradigm, dynamically typed, multipurpose programming language. It is designed to be quick to learn, understand, and use, and enforce a clean and uniform syntax. Please note that Python 2 is officially out of support as of 01-01-2020. Still, for version-specific Python questions, add the [python-2.7] or [python-3.x] tag. When using a Python variant (e.g. Jython, PyPy) or library (e.g. Pandas, Numpy), please include it in the tags.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

The truth value of a Series is ambiguous. pandas DataFrame error

idx = new[new['Result'] == 'TRUE'].index.tolist() idc = old[old['Result'] == 'TRUE'].index.tolist() print(idc, idx) for i,j in zip(idx,idc): print(i,type(i), j,type(j),'---------') ...
0
votes
0answers
9 views

Extracting certain characters from a string

I have this long string: s = "{'shape_attributes': {'name': 'polyline', 'all_points_x': [402, 672, 673, 697, 694, 673, 673, 404, 404], 'all_points_y': [364, 364, 346, 346, 423, 421, 408, 414, 364]...
0
votes
0answers
6 views

Python find outliers [duplicate]

There are so many relevant pieces on SO: Find The Parity Outlier Python Python: Find outliers inside a list Find outlier using z score However, none of them answers my question. I am a chemistry ...
0
votes
0answers
4 views

How to write docstring in python for a function that returns None but write files in disk?

I want to use python docstring to better document my code. In the function below, it takes a list as input and write a file into disk. I want to know how to document the output of function in ...
0
votes
1answer
9 views

Select value based on level filtering of mutiindex

I could find some answer which should have work but strangely it did not. Any help would be appreciated. I have the following dataframe: vendor currency value 2 CKE 3 ...
0
votes
1answer
10 views

estimating a function for values in the text files

I have many text files in the directory(*.txt). And each text files consists of string and float values as given below. /home/lijun/data/2015_0.2_SWE.txt 2.8 1.856 8.9354 /home/lijun/data/2015_0....
0
votes
0answers
6 views

OpenCv Python - Line detection on a book

i would like to know if there is a code to identify the lines on the pages on a CR book using opencv library in python language. Should i use the HSV values to identify them or any other theorems like ...
0
votes
0answers
6 views

CNN Model is predicting only one class using datagen.flow_from_directory

The CNN model will classify between two class with training samples = 6566 and testing = 2392. I am using datagen.flow_from_directory and my model will predict from validation set. For 200 epoch I am ...
0
votes
0answers
4 views

what is the difference between using softmax as a sequential layer in tf.keras and softmax as an activation function for a dense layer?

what is the difference between using softmax as a sequential layer in tf.keras and softmax as an activation function for a dense layer? tf.keras.layers.Dense(10, activation=tf.nn.softmax) and tf.keras....
0
votes
1answer
20 views

Python Syntax Error when entering \ inside quotes [duplicate]

Line of code: typewrite('C\Users\Arthur\Desktop\New folder\a'+picture[i]+'.png') If I remove the \ from the code, the above works so I know the issue is with the \ symbol and do not remember why \ ...
0
votes
1answer
12 views

how to open python web browser in google chrome

I am unable to open web browser in google chrome, it takes me to internet explorer, please say what should I edit in my coding- '''elif 'open stack overflow' in query: webbrowser.open("...
0
votes
2answers
20 views

Passing mutable dictionary as default argument in Python

I am trying to implement the below code to reinitialize a new object. But it isn't happening class A(object): def __init__(self, arg): super(A, self).__init__() self.arg = arg ...
0
votes
1answer
10 views

frogs puzzle using recursion in python

The problem is to write a program that solves the frogs and toads puzzle and with this specific program it has to function with recursion ,so it must have no for/while loops. The puzzle is basically ...
0
votes
0answers
7 views

Error while running apache tika and vision server

i am trying out capabilities of apache tika and got the following error after setting up and running tika and tensor flow recognition server. I installed using docker and followed these instructions ...
0
votes
3answers
30 views

python function Namerror: name 'dictionary' is not defined

I would like to load a file and convert it to a dictionary. then, would like to use the loaded file to display the data. user input for choice is between 1 and 2, in order to decide which function to ...

15 30 50 per page
1
2 3 4 5
102985