Questions tagged as 'python'

1
answer

Multiply matrices 3 * 2 and 2 * 2

Why can not I multiply these two matrices? c = np.array([[1,0], [2,1],[3,8]]) d = np.array([[3,5], [2,3]]) print c*d I do not understand what happens, if I do it with my calculator if I can because it is a 3x2 and a 2x2. I should leave...
asked by 04.11.2018 / 16:19
1
answer

Problem while loop with Python sum

from the following data: restaurantes = [('Burger King', 'MA', 'Chicopee', '1284 Memorial Dr', '1020', '42.1927', '-72.5763'), ("Taco Bell", 'MA', 'Chicopee', '1606 Memorial Dr', '1020', '42.201117596', '-72.574102772'), ('Pizza Hut', 'MA', 'E...
asked by 10.11.2018 / 13:06
1
answer

Can I turn on a pc with python? [closed]

I am working on a software with the python language, where I have to put an option where the user can turn on his PC from another one that has the software. I wanted to know if it can be done from python, or if it can be from another language an...
asked by 07.11.2018 / 14:18
1
answer

Adapting to a model dynamically django

I want to do the following declare a variable that contains the name of the model and travez of those variables execute the queries on that model example model="Person" model.objects.all ()     
asked by 19.04.2018 / 18:33
3
answers

Error accessing SQLAlchemy and mysql database

I have installed an Ubuntu server! 6.04.4 LTS, mysql 5.7.21 and python 3.5.2. I am developing a script in python that gives me the information of the existing databases. The problem is that executing the script always gives me this error:   ...
asked by 08.04.2018 / 23:09
2
answers

Create list from a list with tuples

I need that from this list: cortes=[’raspall’, ’garson’, ’mao-tse’, ’punki’, ’kunki’] And from this list with tuples: prop=[(’mao-tse’, 2), (’raspall’, 5), (’raspall’, 2), (’garson’, 10),(’mao-tse’, 6), (’kunki’, 3)] Show me a list lik...
asked by 04.06.2018 / 13:30
2
answers

Create dictionary from a list

I have this list: laboratorio= [ [’pol’, (’hematies’, 4430000), (’basofils’, 0.5), (’calci’, 9)], [’josep’, (’hematies’, 5130000), (’hematocrit’, 40)], [’enrica’, (’hematies’, 4800000), (’calci’, 11.2), (’colesterol’, 2.3)], [’paco’, (’calci’,...
asked by 03.06.2018 / 23:51
2
answers

How can I make a print in a for loop and it appear without line breaks? - Python

I would like to know how I can make a print in a for loop without the line breaks. In python Thank you very much     
asked by 22.05.2018 / 18:07
1
answer

PYTHON: generate random numbers in a range .. Example: 0 - 100

Good! I would like to know if with phyton you could generate a random number in a range, for example that the range is 0-100 .. It is for a task of a course that I am doing, if you could help me I would appreciate it ..     
asked by 28.01.2018 / 18:16
2
answers

create a json file in Python 3.6.1

I want to create a json file and save it in a path x, below the code I'm occupying. import json import os ruta = {} ruta['nombre']= 'Jose' ruta['edad']='15' ruta['nacionalidad']='Mex' carpeta = 'C:%sPruebas' % os.sep os.chdir(carpeta) #esta es...
asked by 08.02.2018 / 01:01