Select data from a worksheet

1

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

Could anyone give me a hint?

    
asked by anonymous 24.11.2017 / 01:02

1 answer

3

Can this 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
    
24.11.2017 / 10:45