Questions tagged as 'python'

1
answer

Prediction with Neural Networks TensorFlow

Hello, I'm having trouble implementing a neural network. My problem is that I can only implement it with an 'X' attribute I need help in this code for example, how do I put two input attributes? In the case of this code only has the attribu...
asked by 21.08.2017 / 23:14
6
answers

Is there a way to print everything without the line break?

I have this code: print "t" print "e" print "s" print "t" print "e" It has the following output: t e s t e What I find annoying "\n" . Is there a way to print everything without the line break?     
asked by 08.08.2016 / 17:51
5
answers

How to check if the string variable value is number?

I am developing a program where the user types a data, then I have to check if the value is number to proceed with the operation, but if it enters a non-numeric value it is alerted about the invalid value. > I tried to use the type() fu...
asked by 03.06.2017 / 21:07
4
answers

Flatten list of lists. Is a more concise solution possible?

I solved the following Python exercise:    Implement a function that receives a list of length lists   and return a list of one dimension. The solution I was able to do was as follows: #!/usr/bin/env python #-*- coding: utf-8 -*- def l...
asked by 10.03.2018 / 13:44
1
answer

Developing in Python with Visual Studio 2013

I'm trying to develop in Python using Visual Studio 2013 or 2015 because I'm already used to IDE, but I have no experience with the language. In the English SO there is an issue that lists Visual Studio as IDE but many resources are like 'con...
asked by 19.11.2015 / 17:05
1
answer

Retrieving list list values in python

I've tried several things and still can not figure out what the problem with my code is, it's a simple code. With numpy I put the txt values in the arrays array and I want to make some copies for two other lists, mensagem and no ....
asked by 22.09.2015 / 19:05
4
answers

NOT operator in python

In java we have the not operator, we can use it like this: if (!metodo()) { //código } I'm just getting to know python now, and I have a little problem: I have a function that adds names to a list: def adiciona_perfis(): quanti...
asked by 24.10.2016 / 21:44
6
answers

how to search for an element in a list that is within another list?

   I have the following list of lists. [['julian', '0', '5'], ['ana', '10', '4']]    I need to use a function that tells me the position of any element within that list, I tried to use: elemento = lista.index('julian') print (elemento)...
asked by 05.06.2017 / 08:55
2
answers

What is the correct way to call methods in Python?

What is the correct way to make a method call in Python? As in the example below. def __init__(self): mtd([1, 2, 2, 3, 3, 3, 4, 4, 4, 4]) def mtd(data): for value in data: print(value)     
asked by 09.01.2017 / 19:59
3
answers

Fibonacci running in parallel? Threads?

def recur_fibo(n): """Recursive function to print Fibonacci sequence""" if n <= 1: return n else: return(recur_fibo(n-1) + recur_fibo(n-2)) This code makes the recursive fibonacci "simple" ... Imagine that I called...
asked by 10.08.2016 / 02:57