Select data from a spreadsheet

Asked

Viewed 647 times

1

I read data from a spreadsheet using Python 3 libraries (xlrd / xlsxwriter / Pandas and Numpy). This spreadsheet has in the rows questions of the survey and in the columns the areas that answered the survey. Each sentence has a note, that goes from 0 to 100. I need to create a code that I can select only phrases (lines) with notes smaller than 30 for example in all areas (columns).

Could someone give me a hint?

1 answer

3

I wonder if this might help you?

output = []

    f = open( 'arquivo.csv', 'rU' ) #abrir o arquivo em read universal mode
    for line in f:
        cells = line.split( "," )
        output.append( ( cells[ 0 ], cells[ 1 ], cells[ 3 ] ) ) #Neste caso pegaria a primeira segunda e terceira coluna

    f.close()

    print output
  • It didn’t help much. I need to select data of a certain value (int or float). In my problem, each line represents a survey question, which receives a score from 0 to 100. In each column I have the areas of the company that answered the survey. Therefore, I want to select only the smallest notes in each question (row), ("notes smaller than 30 for example"), for each area (column).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.