Questions tagged as 'python-3.x'

1
answer

Display only hours, minutes, and seconds on a chart whose entry is in unix time

Be the Python code that generates a bar chart: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime, timedelta x = [] y = [] with open("dados.csv") as f: for l in f:...
asked by 03.09.2017 / 19:37
1
answer

Bar chart made in Python was "weird". Any suggestions on how to improve it?

Friends, The following graphic was generated: Thecodeusedwasasfollows:#-*-coding:utf-8-*-importmatplotlib.pyplotaspltimportmatplotlib.datesasdatesfromdatetimeimportdatetime,timedeltax=[]y=[]withopen("dataset_semAtaques__10Abril2017_1min.c...
asked by 22.08.2017 / 16:54
1
answer

How do I filter data by date in a dataframe (Python)

Being that you would have to create a new dataframe with the information coming from those dates below. import pandas as pd import numpy as np import datetime %matplotlib inline races = pd.read_csv('races.csv') results = pd.read_csv('results.c...
asked by 20.04.2018 / 10:11
1
answer

Curl Equivalent in python

I was learning to use site APIs for a project, and at the beginning I was struggling and needed to ask. This was the example of using the API to test credentials on the site, I believe it's C ++: curl -u user:password https://myanimelist.ne...
asked by 15.02.2018 / 02:23
3
answers

How to remove unwanted words from a text?

I'm trying to remove unwanted words from any text, but it removes other words. For example: remover_palavras = ["a", "e", "o"] The program returns: btt (potato), mns (less) What to do?     
asked by 30.06.2017 / 20:46
1
answer

How to put a class inside a JSON

Does anyone know how to put a class inside a JSON file? I need to save a class inside a JSON file, however, it returns that this file is not serializable. Does anyone know how I can put this class inside the file, and then use it? Ex: import j...
asked by 06.07.2017 / 15:30
3
answers

Error installing Scrapy package in Python

I'm trying to install Scrapy through pip, but I've been getting errors like:    running build_ext       buildig 'lxml.etree' extension       error: Microsoft Visual C ++ 10.0 is required (Unable to find   vcvarsall.bat). I already have...
asked by 18.11.2016 / 18:44
1
answer

python (on / off switch) [closed]

Hello. I'm learning to program in python3, it's been some time. I am Ubuntu user. I've been creating a script for some time, now I want to improve it, I've looked for some modules and some examples but I did not find anything. I need a scr...
asked by 01.02.2017 / 19:41
1
answer

How to extract the icon of an .exe file using python?

I simply had the need to have a .ico image file extracted from an .exe file and I do not even know how to start it. How can I do this?     
asked by 14.04.2017 / 21:59
2
answers

Problem in condition when checking if user typed "n", "N", "s" or "S"

print("--------------------") print("CALCULADORA DE MÉDIA") print("--------------------") print() #Primeira nota v1 = float(input("Digite a primeira nota: ")) #Segunda nota v2 = float(input("Digite a segunda nota: ")) #Média media = (v1 + v2...
asked by 01.01.2017 / 23:10