Questions tagged as 'python'

2
answers

Error with raw_input

I need to calculate the Laplace transform. For that I used the following code: from sympy.abc import x, s from sympy import Symbol, exp, cos , sin , Heaviside, integrate, limit, oo x=Symbol("x") s=Symbol ("s") f=raw_input(" write any function...
asked by 05.06.2017 / 10:07
2
answers

Python, compare two files

I have to read all the files that are inside a directory and then compare them with those of a .txt file import os from os import listdir from os.path import isfile,join mi_path = "c://python27//proyectos//" f = open(mi_path+'datos.txt', 'r+'...
asked by 13.07.2017 / 13:43
2
answers

Rewrite csv file reassigning columns

I have a csv file (let's call it input.csv) that has the following structure, but that contains a very large number of rows: ID;Texto_1;Puntos_1;Texto_2;Puntos_2 1;"Hola mundo dos";33;"Hola mundo tres";90 2;"Adiós mundo dos";44;"Adiós mundo tr...
asked by 16.11.2017 / 21:09
2
answers

RecursionError on 1000x1000 matrix of the same element. Python

Good, I have a doubt, I'm doing unittest for a function that I have and the problem is that when generating a 40x40 matrix, 50x50 of the same element (for example 'A') onwards generates a recursion error, while that with a function of 1000x1000...
asked by 29.05.2017 / 19:53
1
answer

Distance between point and segment

I want to calculate the distance between a point and a segment, the problem is that I can only calculate the distance between a point and a line (infinite, not bounded by two points). I used this: d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1...
asked by 11.04.2017 / 14:12
2
answers

Define list within matrix

I would like to be able to create a variable that was an N x N matrix and that each of the positions in the matrix would be a list of two elements. and be able to assign them in a similar way to this, within a for loop: matriz[1][2]=...
asked by 10.04.2017 / 15:46
2
answers

.isalpha () with spaces does not work in Python 3x

equipos = ["Barcelona", "Real Madrid", "Manchester United", "Ajax"] print (equipos[0]) print (equipos[1]) print (equipos[2]) print (equipos[3]) while True: equipo = input("\n¿Con que equipo te gustaria jugar? Escribelo aqui: ") if equi...
asked by 21.02.2017 / 11:39
1
answer

Show me a DeprecationWarning when trying to use cross_validation

Currently when executing the CrossValidation and GridSearch module, it shows me this error: C:\Program Files\Anaconda2\lib\site-packages\sklearn\cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of...
asked by 02.04.2017 / 23:10
2
answers

Django urls.py error

Good morning, I am trying to put the 'MEDIA_ROOT' in 'urls.py' but when I run the 'runserver' I get the following error:    File   "C: \ Users \ Manux \ Desktop \ pd110 \ lib \ site-packages \ django \ conf \ urls \ static.py",   line 24, in...
asked by 31.03.2017 / 16:33
1
answer

Python element IN list of strings

I have the following list and string: lis = ['ejemplo 1', 'ejemplo 2', 'cualquier cosa'] palabra = 'ejemplo' But when I do palabra in lis Returns False . For what is this? How can I solve it?     
asked by 02.12.2016 / 18:21