Questions tagged as 'python'

1
answer

You can not train a Rasa model using spacy

I tried to create my first chatbot on my own with the help of Rasa and this tutorial . p> He proposes to use Spacy , a library for advanced processing of natural language in Python mike@mike-thinks:~/Programing/Rasa_tutorial/rasa_nlu$ pyt...
asked by 11.05.2018 / 01:19
1
answer

Compare the name of the fields of a dataframe in python with pandas

import pandas as pd main_file_path = '../input/train.csv' df1 = pd.read_csv(main_file_path) main_file_path2 = '../input/test.csv' df2 = pd.read_csv(main_file_path2) df1.columns df2.columns How can I know the fields they have in common and th...
asked by 21.03.2018 / 21:28
1
answer

Is it possible to do a delay in python without stopping the program?

Hello today I asked myself if it would be possible to do a delay in the background or something so that the program does not stop. Is it possible? I would like to have a rectangle moved to a position x every 2 seconds and after another 2 seco...
asked by 02.03.2018 / 22:56
3
answers

Separate CSV lines by "/" python

I need to make some changes to my csv. I seek to separate the rows that I have in country by the "/" and duplicate them. Basically I explain a little because I need to do this: When I have a "/" in the row of Country it means that they ar...
asked by 20.03.2018 / 21:54
1
answer

Encrypt text string with SHA1

I have the following code in Java: import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Base64; public class EnconderPass { public static void main(S...
asked by 23.07.2017 / 23:43
1
answer

Django queryset, calculate subtraction of two numbers

I have the following model: class MyClass(models.model): usuario = models.Charfield(max_length=45) saldo_ini=models.DecimalField(decimal_places=1,max_digits=10, null=True) saldo_fin=models.DecimalField(decimal_places=1,max_digits=1...
asked by 25.07.2017 / 00:10
1
answer

Problem with global variable

I am preparing an exam and I have been doing several exercises, the problem arises when I get to the part of object-oriented programming (OOP) in this exercise:    Write a class that allows you to represent the character of a video game.   A...
asked by 18.02.2018 / 21:06
1
answer

TypeError: Image data can not be converted to float

I have a problem with the following code: import cv2 import matplotlib.pyplot as plt img1 = cv2.imread('images\colombia_city.jpg') img2 = cv2.imread('images\colombia_city_2.jpg') #img = img1 + img2 #img = cv2.add(img1,img2) abc = cv2.addWei...
asked by 18.02.2018 / 02:50
1
answer

Problems building a dictionary to return a Queryset

When I want to obtain a queryset filtering according to several parameters I use a dictionary, for example: queryset = Actividad.objects.filter(**my_filter) Where my_filter has been constructed in this way: if nombre: my_fi...
asked by 15.02.2018 / 15:10
1
answer

How to use python3 by default in mac?

I'm starting to use python on mac and I have a problem that I can not solve. I have installed the latest version of python 3.6.4 in macOS High Sierra. In sublime text I have installed the sublimeREPL package, with which I use the option: "...
asked by 17.03.2018 / 21:15