Questions tagged as 'python-3.x'

1
answer

TypeError: 'numpy.float64' object can not be interpreted as an integer

I try to perform an arithmetic operation using values obtained from a DataFrame using statements df.loc[] . The sentence beneficio = (cotz_fin - cotz_ini) * opcion produces the error:    "TypeError: 'numpy.float64' object can not...
asked by 13.11.2017 / 14:50
1
answer

Print the results of consultation records with LIKE. mysql + python3

Hi, I would appreciate it if someone could help me with this problem. I want to print each of the results that this query would throw at me, as when it is executed in MySQL. What I want is for example to obtain all the records that contain the w...
asked by 10.11.2017 / 10:10
0
answers

Error: Microsoft Visual C ++ 10.0 is required (Unable to find vcvarsall.bat).

I've been trying to connect Python with MySQL and I could not connect, I'm using Python 3.4 and MySQL Workbench. I have already installed the Microsoft Visual C ++ 2010. If anyone knows, please help me.     
asked by 13.11.2017 / 22:36
1
answer

I do not load styles when starting a server in flask

I do not load the css styles of my page when I start it with flask, but I open the file on my own if I upload them. This is my flask code: from flask import Flask from flask import render_template app = Flask(__name__) @app.route('/') def...
asked by 07.11.2017 / 21:38
1
answer

Error when running flask

My mistake: (flask_env) C:\Users\pcort\Documents\tuMicrofono.com>index.py Traceback (most recent call last): File "C:\Users\pcort\Documents\tuMicrofono.com\index.py", line 1, in <module> from flask import Flask File "C:\Users\...
asked by 07.11.2017 / 18:39
1
answer

Passing data from a csv to a list

I have a csv similar to the following: ID;texto 1;Los niños comen sardinas 2;Los pájaros vuelan alto porque tienen alas 3;Érase una vez la vida 4;Un 67% de los adultos vive en la pobreza I want to read the csv and extract the text column. I...
asked by 04.11.2017 / 14:27
1
answer

Extract rows from a database

import pandas as pd datos=pd.read_csv('datos.csv', header=0 ) datos=(datos[datos.iloc[:,3]>=0]) anios1=datos[datos.iloc[:,2]==1975] Use this code to read a database, this database stores precipitation in a certain area every day every da...
asked by 19.10.2017 / 01:06
1
answer

Formulate Url with return variable in Django

I am currently taking a project in django implementing the jinja2 library, which I need to perform a hyperlink that returns a variable but it is giving me an error and I am not sure if it is because of the syntax. Template: <a href="{{ u...
asked by 13.10.2017 / 14:57
0
answers

Django REST framework returns "Got AttributeError when attempting to get a value for field"

The problem I have is when I try to access the api in link is throwing me this error:    Got AttributeError when attempting to get a value for field name on serializer BattleSerializer . The serializer field might be incorrectl...
asked by 02.10.2017 / 05:32
2
answers

Count all the characters except a few

I'm trying to count all the characters of a string other than four that I have reserved. for example: s.count (I want all the characters of a string (s) except 4: a, c t and g) How could you count all of them except the four mentioned?...
asked by 28.09.2017 / 22:59