Questions tagged as 'python'

0
answers

How to Move Servo Motor Sg90

How would I do to where the print("RED") , print("GREEN") and print("BLUE") to move a servo motor to 180 °, what happens is that the motor does not move, (I'm using raspberry pi 3 b +). if r >= 50 and g >= 50 and b &g...
asked by 14.11.2018 / 16:33
0
answers

What is the difference between Train Test Split and Holdout?

From what I've already researched, they both divide the set into two subsets of training and testing. Are there any differences between the two?     
asked by 14.11.2018 / 15:23
1
answer

How to transform an HTML table into a Data Frame

I'm trying to integrate a python script with an HTML table How can I do this? Follow my table. <table data-spy="scroll" class = "table-responsive-sm" id="table-prem" > <thead>...
asked by 22.11.2018 / 21:27
2
answers

Get Data in JSON structure with python

I want to access certain information in the JSON code below, with python: { "informacao1": valor_informação1, "informacao2": "{ dado=informação_dado }" print(arquivojson.get("informacao1")) The above print will display the line bel...
asked by 21.05.2017 / 16:42
1
answer

My script that searches for a string in another is taking too long

My script loads the command1 (file1) and saves the first column of all rows in a vector, later it will look for each substring of that vector in a file 2 (of command2). The problem is that file 1 has about 3,000,000,000 lines and file 2 has abou...
asked by 18.11.2018 / 15:12
0
answers

Transparent data download with application form

I'm trying to put together a script for web scraping, however it's a lot of data and using selenium has not been a good solution. To do all the downloading I would demand at least 12 days. How can I optimize this script? I wonder if having a for...
asked by 18.11.2018 / 19:47
1
answer

Python - Json: KeyError

I'm making the call into a MailChimp API in which I ready the fields to insert into my DB. In the JSON provided by the documentation, the following fields appear: { "automations": [ { "id": "b0a1c24f1a", "create_time": "2015-09-15T14...
asked by 21.11.2018 / 17:59
0
answers

Inserting data in python

How can I make the file below do what you need in print? import glob, os, codecs, sys, codecs # ================================= # Metodos para Indexacao # ================================= def tokenizacao(documento): # retorna list...
asked by 19.11.2018 / 23:05
1
answer

How to remove a line in txt file in python

Good night, I'm having problems removing a line from a txt file, the delete function of the code is responsible for removing a user, however when I try to remove the whole file it is deleted. def deleta(): usuario = input("\nUsuário: ") +...
asked by 12.11.2018 / 02:19
1
answer

Select rows by first digits, and average them by year

I have a CSV of the following type: code year sales 2011 1970 5000 2011 1971 5200 2011 1972 ... ... 2015 1970 2015 1971 2015 1972 ... 3025 ... 3026 ... 3052 ... How can I select all the code lines starting with '2...
asked by 10.11.2018 / 02:10