Questions tagged as 'python'

0
answers

Query about brackets in python

Taking into account the following code: def recommend(username, users): nearest = computeNearestNeighbor(username, users)[0][1] recommendations = [] neighborRatings = users[nearest] userRatings = users[username] for artist in neigh...
asked by 12.12.2018 / 13:02
0
answers

Connections to Oracle Database with Python

I have tried to make a connection to an Oracle DB from my script using import cx_Oracle Since my local machine works well (I have an Oracle of 32 and 64 bits) but in the client I have an error because they have installed an Oracle of 32 and...
asked by 11.12.2018 / 11:38
0
answers

How to track an object by its color in Python?

How about companions? I have the following question, how do I rewrite this code in Python language? #include <iostream> #include <string> #include <vector> #include <opencv2/highgui/highgui.hpp> #include <opencv2/im...
asked by 04.01.2019 / 21:21
0
answers

Event when selecting a row from a table in python

The code of my table is: from PyQt5 import QtCore from PyQt5 import QtWidgets from PyQt5 import QtGui import configparser import os from util.excelUtil import * class Tabla(QWidget): ''' Metodo base para la creación de una tabla con el botón...
asked by 18.12.2018 / 12:47
0
answers

Creepy error from PyQt4.QtWebKit import QWebPage, QWebSettings ImportError: No module named QtWebKit

When running sudo python CreepyMain.py I get the following error:    Traceback (most recent call last): File "CreepyMain.py", line 20, in          from PyQt4.QtWebKit import QWebPage, QWebSettings ImportError: No module named QtWebKit...
asked by 09.12.2018 / 04:01
0
answers

TypeError: translator () missing 1 required positional argument: 'word'

esoty doing a practice of python but I have run into a problem when running the code import json from difflib import get_close_matches from flask import Flask, render_template from flask_bootstrap import Bootstrap app = Flask(__name__) Bootst...
asked by 17.12.2018 / 23:23
0
answers

Create an array by iterating the rows of a table of pandas with conditions. Python

I'm creating a table with pandas where the first two columns are created with numpy arrays: age = np.random.randint(20,85,size=400) possible_genders = ['male','female'] gender = [np.random.choice(possible_genders) for i in range(400)] the...
asked by 09.12.2018 / 19:58
0
answers

try + except or if + else?

I am writing some functions in python3 to work with some GPS data received by UART. Those data I have to cast them and leave them ready to later work with them. However, I am faced with the question of how to do it, because at first I had tri...
asked by 12.12.2018 / 20:08
4
answers

Program to count the vowels of a chain

   "Perform a call_count_name () function that receives as an argument any string and returns the number of vowels present in the string." def contar_vocales(x): voc=0 for i in len(cad): if cad[i]=='a' or cad[i]=='e'or cad[i]=...
asked by 04.11.2017 / 20:53
0
answers

Get of Entry does not work (python (tkinter))

I need to do the following exercise, the problem is that when I want to use the var.get () does not return anything, does not give an error, only returns nothing. I tried to use it inside the main and it works, but inside the function, can someo...
asked by 13.12.2018 / 19:07