0
Is it possible to generate a tuple that stores the values of the lines of a dataframe generated by pandas? I uploaded the values of a CSV file to a dataframe, now I need to perform some calculations with these values, but I did not find hints on the internet. Thanks.
For example: tuple = "value","valueB".
Where tuple is the column name.
valora is the value contained in first row of this column.
valorB is the heat contained in second row of this column.
And so on and so forth while there are lines in the dataframe.
import pandas as pd
df = pd.read_csv("TESTE.CSV", sep=",",header=None,usecols=[0,1,2,3,4,5,6],engine="python")
print (df)
Oops, all right? So I store all the values from df, right? There’s a way to create a tuple for each column?
– Matheus
Right, so it stores all the data in the column at the address 0 of the tuple. Is there any way to store the data in the column at different addresses? for example: tuple[0] contains the die of row 0, tuple[1] contains the die of row 1 and so on until the column is finished.
– Matheus
In fact the structure of tuples is as follows:
tuples[coluna][linha]
, for example tuples[0][1] will return the value of row 1 and column 0, the value of tuples[1][1] will return the value of row 1 and column 1 and tuples[0][3] will return the value of row 3 and column 0– brow-joe
Right, helped me a lot! Thanks Brow-joe!!!
– Matheus