This is a real problem I've faced for a long time.
Take this dataframe:
A B THRESHOLD
NaN NaN NaN
-0.041158 -0.161571 0.329038
0.238156 0.525878 0.110370
0.606738 0.854177 -0.095147
0.200166 0.385453 0.166235
It is easy enough to copy using pd.read_clipboard
. However, if one of the column names has a space:
A B Col #3
NaN NaN NaN
-0.041158 -0.161571 0.329038
0.238156 0.525878 0.110370
0.606738 0.854177 -0.095147
0.200166 0.385453 0.166235
Then, it is read like this:
A B Col #3
0 NaN NaN NaN NaN
1 -0.041158 -0.161571 0.329038 NaN
2 0.238156 0.525878 0.110370 NaN
3 0.606738 0.854177 -0.095147 NaN
4 0.200166 0.385453 0.166235 NaN
How can I prevent that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…