Questions tagged as 'python'

1
answer

Specific section break in JSON file with python

Is it possible to perform a line break from a specific JSon thread, transform into an array, and then dynamize? Why I'm asking this .. I'm developing a file mining bot and I came across a situation where some pages return only one file on that l...
asked by 29.05.2018 / 14:01
2
answers

Define functions for equal values and values in ascending order - Python

Hello, I have defined a function for reading 100 records records, containing name, gender and age, and now I need a separate function to show how many people are male and another separate function to show the vector in order growing. How could it...
asked by 08.06.2018 / 00:21
1
answer

Parking class in Python

I'm learning to program in Python. At this point I need to implement a class that has the following characteristics: A class called parking, which simulates the operation of a parking lot. - The class receives an integer and determines...
asked by 09.06.2018 / 17:35
1
answer

Write a string list in a file

I have a list and I wanted to write to another file ["AMANDA,"JULIANA","VANESSA","PATRICIA"] In a document using Python, I did however the file get all together type like this: AMANDAJULIANAVANESSAPATRICIA How could I fix this? def o...
asked by 24.05.2018 / 16:55
1
answer

list index out of range, genetic algorithm

I'm having problems on the line that is parcial += pacum [i-1] I'm getting the error "list index out of range", about the variables and lists: Population and fitness list depend on the size Population that can be any integer value. def s...
asked by 21.05.2018 / 03:47
1
answer

Adding grouped total sum to a new DataFrame pyspark column

I have a dataframe with the following columns: COL1 COL2 COL3 NEW_COL* A asd 1 8 B adf 2 9 A adg 8 1 B adh 9 2 C adj 7 7 D adk 1...
asked by 30.05.2018 / 23:32
1
answer

Assign day time to hours

I have the following df: df = pd.DataFrame({'hora completa':['21:35:00', '22:16:00', '00:50:00', '09:30:00', '14:30:00']}) print(df) hora completa 0 21:35:00 1 22:16:00 2 00:50:00 3 09:30:00 4 14:30:00 I need to...
asked by 14.06.2018 / 05:59
2
answers

Add the first "n" elements of a geometric progression in Python

A program to add the first "n" elements of a progression geometric, given the first element "a0" and the ratio "r" between the elements. For example, for n = 7, a0 = 1, r = 3: 1 + 3 + 9 + 27 + 81 + 243 + 729 = 1093     
asked by 16.05.2018 / 23:22
2
answers

What's wrong with this line of print = ('Hello,' + full_name.title () + '!')? [closed]

I'm new to programming and I'm following the exercises in Eric Matthes's book. In the text editor, I typed print = ('Hello,' + full_name.title() + '!') and an error message appeared.     
asked by 17.05.2018 / 03:58
1
answer

Filter lines on pandas by a list

Given the dataframe below, I'd like to filter the row data based on the 'Filterlist' list. nome valor 0 foo 2 1 bar 3 2 fiz 2 3 zaz 5 4 foo 6 5 far 7 6 bar 2 7 fiz 9 8 zoo 6 9 boo...
asked by 22.06.2018 / 15:52