Questions tagged as 'python-3.x'

1
answer

Importing modules and hierarchies - Python

Personally I have the following question. I am studying importing modules and grabbed the following problem, my directory is configured as follows: Doubt 1 - > I want to import the operation modules to print and vice versa Doub...
asked by 21.01.2017 / 11:17
1
answer

Incompatibility of architecture between drive and application

I'm trying to access data from a database using pyodbc with this code: import pyodbc cnxn = pyodbc.connect("DSN=banco;uid=usuario;pwd=senha") cursor = cnxn.cursor() But when I run this error:    pyodbc.Error: ('IM014', '[IM014] [Microsof...
asked by 07.12.2016 / 19:47
1
answer

Pandas Conditional Sum

Hello. I have the following situation df1 = pd.DataFrame({'Key':['a','b','c','a','c','a','b','c'],'Value':[9.2,8.6,7.2,8.3,8.5,2.1,7.4,1.1]}) df2 = pd.DataFrame({'Key':['a','b','c']}) And I would like the following answer in [0]: df2 ou...
asked by 30.11.2016 / 11:41
1
answer

Verify the type of input

Good people! I need to do an input check for a job and I can not do this properly. This is what I have until agr: def verificação1(): while True: try: quantidade=int(input("Insira a quantidade: ")) quantida...
asked by 24.11.2016 / 10:43
1
answer

Matrix (Create 2 Matrices and Sums them up)

How could I build this array without using random / randit? Then I need to do the element-by-element sum function of the first two. The sum must be solved via subprogram written for this purpose. This subroutine should only take the two input ar...
asked by 22.08.2016 / 15:29
2
answers

Problem in Inserting an Array

Well, I'm trying to learn python because it seems to me a language with some interesting applicability in the most diverse areas (and I'm interested in raspberry). As I am learning, I like to go about something that I need to apply the knowle...
asked by 13.06.2016 / 22:55
0
answers

Selecting and deleting random csv lines in python [closed]

I need to make a small python script that meets the following requirements: Open a csv file; Exclude from reading the first line and the first column, because it contains information that will not be necessary in this computation itself;...
asked by 24.07.2016 / 04:55
1
answer

Move subfolders with python

Good morning, at some point I've been trying to create a python script to search sub directories from one folder to another for example: root -pasta1 --pastaa --pastab -pasta2 -pasta3 --pastac --pastad I've been unsuccessfully tryin...
asked by 18.05.2016 / 16:45
0
answers

How to put a progress bar for a process in Flask?

Hello, When you click the 'Submit' button, the selected file (.jpg) is copied to several directories. I want to show this process to the user through a simple progress bar. Any tips? This is part of my script to copy the selected file to o...
asked by 11.05.2016 / 20:03
2
answers

Various keys and values, dictionary comprehension

I've been playing around with python, dict and list comprehensions. I made this little script: import requests url = 'http://www.bankofcanada.ca/en/markets/csv/exchange_eng.csv' resp = requests.get(url) page = resp.text lines = [line for li...
asked by 10.05.2016 / 16:06