Questions tagged as 'python'

1
answer

Segment image and highlight object border using python

I'm testing some algorithms to improve the image quality my hardware is getting. I have a vane in the image and would like to highlight the object contained in it. Iusedthecodebelowtodotheequalizationoftheimage,butIdidnotsucceed.importcv2imp...
asked by 08.06.2017 / 21:08
1
answer

Create tuples of dataframe generated by Pandas

Is it possible to generate a tuple that stores the row values of a dataframe generated by pandas? I uploaded the values from a CSV file to a dataframe, now I need to perform some calculations with these values, but I have not found any tips on t...
asked by 27.04.2017 / 21:27
3
answers

How to open .txt files in Python?

I want to open a .txt file for reading but python always gives error, either use f = open('ficheiro.txt', "r") or f =open('C:\...(diretório)...\ficheiro.txt', "r") I have already created files from python to know where they are stored...
asked by 30.04.2017 / 17:48
1
answer

Help python getting only the last data from the list

I have a website and need a name separation system: surname with list, the data stays in a txt and I normally import the data stand for example: maria: carla joao: lima I wanted to be able to separate as follows when giving this print in data he...
asked by 28.04.2017 / 04:39
2
answers

Find the largest value of any file in python

Good night DEVs! I'm having some difficulties in handling files in python. I have a TXT file with Float numbers. Example:    numeros.txt         77 23   9 10 20.26 -20.26 2 Having this data in hand, I have to go through line by l...
asked by 26.04.2017 / 03:11
1
answer

Using "if / elif / else" with return is good programming practice? [closed]

Eg: return (sum*2 if a == b else sum)     
asked by 24.04.2017 / 01:46
1
answer

Use function from an external folder

I have the following situation: Within Pasta1\ I have a file that is my main code This file codigo_principal.py reads a file that is in a subfolder within Pasta1\ I also have another folder, Pasta2 , and i...
asked by 26.06.2017 / 01:09
3
answers

read text file and generate lists for each line with element separation

   In python, I have for example the following lines in a text file: 1, julian, 0.5,6,7,8,9 2, ana, 01,9,5,6,8,1 and wanted to generate lists: list1 = [1, 'julian', 0.5,6,7,8,9] list2 = [2, 'ana', 01,9,5,6,8,1]    Citation bec...
asked by 05.06.2017 / 05:32
2
answers

Remove items from a list

['# cultura de alface (parcial)\n', 'volume:5:0.25:m3\n', 'PH:7.5:0.45:-\n', 'nitrato de calcio:750:51:ppm\n', 'nitrato de potassio:500:45:ppm\n', 'sulfato de magnesio:400:25:ppm\n', 'sulfato de manganes:1.5:0.45:ppm\n', 'fosfato monoamonico:150:...
asked by 04.06.2017 / 17:04
1
answer

How do I import image into Python with the Tkinter GUI? [closed]

Can you put image in the tkinter library widget?     
asked by 06.06.2017 / 02:21