QST: About the meaning of ~
used in dfs = dfs.loc[:, ~dfs.columns.str.contains('^Unnamed', na=False)]
.
#43832
Closed
2 tasks done
Labels
I have searched the [pandas] tag on StackOverflow for similar questions.
I have asked my usage related question on StackOverflow.
Link to question on StackOverflow
https://stackoverflow.com/a/64335734
Question about pandas
Currently, I'm using the following method to get rid of
Unnamed: 0
column in a pandas DataFrame according to the comments noted here and here:But I am puzzled by the meaning of the
~
symbol used above. I try to find some relevant explanations by googling or digging into the source code of pandas, but still got nothing. Any hints for this question will be greatly appreciated.Regards,
HZ
The text was updated successfully, but these errors were encountered: