Questions tagged as 'python'

0
answers

How to check request.data variables? DRF

I am modifying an API service in Django Rest Framework and I have an error to check if there is a field in the JSON sent by the client. I have a Comments ViewSet that can be associated to a product or a look, so, in the create() of the...
asked by 16.04.2018 / 08:13
1
answer

Keras: ValueError: Dimension 0 in both shapes must be equal (VGGNets)

I'm following a tutorial and I loaded the pre-trained VGGNet16 model using Keras vgg16_model = keras.applications.vgg16.VGG16() model = Sequential() for layer in vgg16_model.layers: model.add(layer) model.layers.pop() for...
asked by 15.04.2018 / 19:02
0
answers

Problem with Websocket in python

I have an error in python, I am working with webSocket: [Errno 98] Address already in use try I know this originates because the process is already running, how can I validate this, so that it is ignored when it is created and does not gene...
asked by 17.04.2018 / 20:46
1
answer

I can not get data from the database in Django

I have an error that has been happening to me for two days, which I do not understand what it may be, is when I try to obtain the information from the database with the employee model, the code is as follows: from django.shortcuts import rende...
asked by 11.04.2018 / 19:25
2
answers

Pandas. Import all the columns of an Excel sheet in Jupyter Notebook

In an open book in Jupyter Notebook, I try to import all the columns of an Excel sheet (16), using the script file = "datos.xlsx" # Import the data df = pd.read_excel(file, sheetname = "Financiera", na_values = "n/a") The script works corre...
asked by 10.04.2018 / 22:20
1
answer

Run Script with probability of failure in Python every second

Good afternoon, classmates. I am relatively new to programming and I developed my first Bot for some tasks, it is already finished but I have a small problem to execute it constantly since it occasionally fails for a foreign reason (sometimes...
asked by 09.04.2018 / 22:17
0
answers

Several problems with Client.py module

This comes from before, because I am with a simple client and server project in python, which includes a GUI (wxpython) in the client module. The case is as follows: Here I present the basic server code:     import socket     import threading...
asked by 11.04.2018 / 15:03
1
answer

Inculse entire object in JSON APIs

Good morning. I am building an API for users, I use jango REST Framework JSON API, the problem is that JSON Api responds in the following way: { "data": { "type": "UserViewSet", "id": "3", "attributes": { "password": "b'$2b...
asked by 06.04.2018 / 17:31
1
answer

problem return option buttons tkinter

I CAN NOT RETURN THE VALUES OF THE 2 BUTTONS WITH A SINGLE FUNCTION from Tkinter import * def start(): recuperacion= Recovery() class Recovery(): def __init__(self): global v recovery= Tk() v = IntVar...
asked by 05.04.2018 / 13:44
1
answer

Sort a dictionary in python

My question is that I want to sort the elements of a dictionary alphabetically and I do not know how to do it. My dictionary gives me: _init 4 other 6 hello 8 hello 12 And I want you to give me: _init 4 hello 8 hello 12 other 6...
asked by 05.04.2018 / 12:29