Questions tagged as 'python'

1
answer

Store data generated in a cycle for a list

I have a problem, within a cycle for I have a variable that is changing value and I want to save each value generated within a list to be used in other operations. In my case, the variable that changes value is Asx , and I want to s...
asked by 16.11.2017 / 01:49
1
answer

Error: csv.Error: field larger than field limit (131072)

I have a program that opens csv files, operates with phrases and records data in another csv file. I am now getting an error that I had never obtained before. I have searched the Internet for solutions but I can not find much. The error is...
asked by 07.11.2017 / 16:14
1
answer

Error '' 'bool' object is not subscriptable ''

I do not want to sound demanding or anything so I just want to ask you a huge favor, I try to make a program that has 20 rooms (they are all those s1 , s2 etc with true ) tell me if they are busy or no, if ' 'numero de habi...
asked by 26.11.2017 / 19:19
1
answer

Systems of differential equations in Python

I have problems solving the following system of equations: import numpy as np import scipy as sp from scipy.integrate import odeint import matplotlib.pyplot as plt R1=8 R2=3 L1=1 L2=1 def RLC(I,t): di1_t=(-(R1+R2)/L2)*I[0] + (R2/L2)*I[1]...
asked by 23.11.2017 / 03:33
1
answer

Convert a text file into a list

I am trying to convert a text file into a list, using Python. The text file are many words, one below the other. What I did was this: stop_words=open('stopwords.txt.txt','r') lineas = [linea.split() for linea in stop_words] for linea in...
asked by 21.11.2017 / 03:01
1
answer

Validate a field in python

this is my code: from math import * import os import time import sys salir = False print("por favor no escribir cosas no relacionadas o el programa dara error") print("cargando...") time.sleep(3) os.system('cls') while not salir:...
asked by 05.01.2018 / 07:25
1
answer

Warning in conditional sentence

I have a variable save to store the directory that indicates where to save a graph or, otherwise and by default, it has the value False . Next, the following sentence: if save != False: plt.savefig(save + "/" + title + ".pn...
asked by 05.01.2018 / 11:29
1
answer

Problem in counting string words using dictionaries

Hi, I'm working on a program where a user can put any type of words and my program brings out the different types of words and the top 5 most used words this is my code: contador = {} grupo = {} while True : palabras=input("ponga pal...
asked by 30.10.2017 / 16:20
1
answer

Renew Tor's IP in Python

I have the following code: import requests import time from stem import Signal from stem.control import Controller def get_tor_session(): session = requests.session() session.proxies = {'http': 'socks5://localhost:9050','https': 'soc...
asked by 29.10.2017 / 19:18
2
answers

How can I simplify these conditions, is there any way?

Is there any way to simplify these conditions to a shorter one? saldo_mes_corriente= CreditoBd.objects.filter(fecha_reporte=fecha_cierre).aggregate(Sum('saldo_credito')) saldo_mes_anterior= CreditoBd.objects.filter(fecha_reporte=fecha_...
asked by 28.10.2017 / 21:34