Questions tagged as 'python-3.x'

1
answer

Filling in Python

Good morning, I have a data frame with air temperature, global radiation and CO2, but my CO2 data is with NaN and I need to find data in other "lines" similar to fill the Nan with the CO2 data. import numpy as np import pandas as pd df...
asked by 13.03.2017 / 14:16
1
answer

Sending POST with Python through curl

I want to turn the form (which is working) into a curl to run on the backend <form action="https://pt.stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fpt.stackoverflow.com%2f" method="post"> <input type="te...
asked by 28.02.2017 / 13:42
1
answer

How to sort a dictionary that takes a tuple with key

I have a dictionary like this: dicionario = {(0,0,0):['alguma informacao']} How can I sort this dictionary from one of the key information? For example: dicionario = {(0,0,0):['alguma informacao'],(0,0,1):['alguma informacao'],(0,0,2):['a...
asked by 29.08.2017 / 14:48
1
answer

How to transform a String list into a Float list?

If I run this code, it will give a list in string: SothatIcannotdotheaverageofthenumberscorrectly(sinceitisinstring).WhatcanIdotogetthenumberprintedinfloat/int?Doesthis"error" happen only with Python.3x? What would happen if I migrated to 2x...
asked by 23.02.2017 / 04:47
1
answer

QuerySet model Category, Product and ProductImage

Hello, help me build this queryset. Briefly, the model model.py class Category(models.Model): name = models.CharField('Nome', max_length=100) slug = models.SlugField(max_length=100, unique=True) created = models.DateFiel...
asked by 08.02.2017 / 00:09
1
answer

Reportlab in Heroku - Error of words with accent

I am generating reports with reportlab But when you have words with an accent, I'm taking 500 Internal Server Error no Heroku . Localhost works perfectly. I tried the following did not work reports.py # -*-...
asked by 17.03.2017 / 01:14
1
answer

How to make the link clickable, to be accessed?

print('-----') print('SITES') print('-----') print() print() print('Duolingo Brasileiro') print('Duolingo Inglês') print('Duolingo Alemão') escolha_site = str(input('Escolha qual versão do site do duolingo deseja acessar: ')) if escolha_s...
asked by 22.02.2017 / 20:04
1
answer

How to convert a string to an integer in a socket program?

Here is a snippet of code: def CriarServer(self): Host = self.Txt1.get() Port = self.Txt2.get() sockobj = socket(AF_INET, SOCK_STREAM) #Erro sockobj.bind((Host, Port)) sockobj.listen(5) while True: da...
asked by 03.01.2017 / 20:13
1
answer

TabError: inconsistent use of tabs and spaces in indentation

I'm trying to write a script and only the first part works: import re with open('lista.csv', 'r') as f: primeira_linha = f.readline() #print(primeira_linha) outras_linhas = f.readlines() #print(outras_linhas) for linha in...
asked by 29.11.2016 / 14:54
1
answer

Dictionary in python

Good morning! I'm having trouble breaking information and dictionary in python. My dictionary is a dictionary generated by Biopython like the one below: {'LastUpdate': '2016/11/11 04:34', 'Count': '26645932', 'DbName': 'pubmed', 'LinkList': [{...
asked by 12.11.2016 / 14:35