I have a Dataframe that looks like this:
>>>df
Source Log Size
0 USB file.txt 256
1 Bluetooth song.wav 75
2 USB spreadsheet.xls 129
I want to splicate based on a column Source, and then select only the column Log. The following code works, but I don’t think this is a way to write it, because I read that it is wrong to use inverse brackets ][.
df[df['Source'] == 'USB']['Log']
Is there a better way to do this?
source
share