Questions tagged as 'python'

1
answer

TypeError: 'int' object has no attribute '__getitem__'

I have a data frame with different identification numbers and I am trying to format it in two sections, if it has more than 10 digits the format is: 123.456.789-0, if it is different to 10 digits (less or more) the format is : 123,456,789 / 123,...
asked by 20.10.2018 / 01:25
1
answer

Read full data of a json

I'm trying to read the following json the problem that I can not find to read the whole structure. Json: [ { "fecha_fin": [ "10:00 21 de noviembre de 2018", "10:00 21 de noviembre de 2018", "10:00 21 de noviembre...
asked by 24.10.2018 / 18:14
1
answer

how do I assign words to numbers using random in python?

I would like to know how to have a str instead of a number (without using lists or random.randint) import random prob=random.randrange(1,5) 1 = pedro 2 = maria 3 = juan 4 = luis print (prob)    Traceback (most recent call last): File "pyt...
asked by 12.10.2018 / 06:22
1
answer

Relay, relay, relay does not turn on when running shell_exec or python exec in php7

Hi, I have this code on the Raspberry pi zero w: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title></title> <link rel="stylesheet" hre...
asked by 15.10.2018 / 06:16
2
answers

Run compiled .exe from ptyhon and Firebird / Interbase in different versions of Windows

Hi, I have a problem in executing .exe compiled with cx_freeze from a .py and executing them in different versions of Windows, they do not have python installed ...... Maybe I miss them because they need them the installation of python and the l...
asked by 06.04.2016 / 18:57
1
answer

Carry a day count to rent a car, python

I'm doing an application in python, a simulator to rent a car, for now I'm doing it with 1 car in my stock. the number of cars and days is given by a ramdom and according to the range in which it falls, the amount is assigned. the normal flow...
asked by 09.10.2018 / 01:23
1
answer

Keep counter in python

Good day. I am doing a simple program that takes me the sum of each iteration of vehicles, and in the end it shows me the total amount of them. The code I made is the following: from random import random nAutos=0 for i in range(3): aleator...
asked by 03.10.2018 / 18:14
1
answer

Intradia google finance

I have to work with google finance data to do an intraday data modeling, that is, I need the values every minute or every five minutes for a day. I'm doing it with python with the following example: uri = 'http://www.google.com/finance/getp...
asked by 22.11.2018 / 12:37
1
answer

Python: Assignment or erroneous data printing in nodes

I recently started a question about python, the problem was solved, but now all I need is to solve a problem with assigning and printing values of one (or several) instances of a class. I enclose the output on the screen: I attach th...
asked by 01.10.2018 / 08:27
1
answer

AttributeError: 'Mul' object has no attribute 'eval'

I have a problem with this code, which calculates the eigenstates for the quantum harmonic oscillator and evaluates it in a given time. In turn, I try to plot all the state subplots for each value of n. But this error appears: for i in xx: reP...
asked by 30.09.2018 / 23:44