は別のquestionからのデータフレームです:pd.read_clipboardを使用してきれいに印刷された/フォーマットされたデータフレームを読み込みますか?ここ
+--------------------+---------------+-------+
| Location | Date | Value |
+--------------------+---------------+-------+
| India | 2015-03-15 | -200|
| India | 2015-02-15 | 140 |
| India | 2015-01-15 | 155 |
| India | 2015-12-15 | 85 |
| India | 2015-11-15 | 45 |
| China | 2015-03-15 | 199 |
| China | 2015-02-15 | 164 |
| China | 2015-01-15 | 209 |
| China | 2015-12-15 | 24 |
| China | 2015-11-15 | 11 |
| Russia | 2015-03-15 | 48 |
| Russia | 2015-02-15 | 104 |
| Russia | 2015-01-15 | 106 |
| Russia | 2015-12-15 | -20 |
| Russia | 2015-11-15 | 10 |
+--------------------+---------------+-------+
そして、便宜上、ここであなたは何の問題もなくコピーできるバージョンがあります:
Location Date Value
0 India 2015-03-15 -200
1 India 2015-02-15 140
2 India 2015-01-15 155
3 India 2015-12-15 85
4 India 2015-11-15 45
5 China 2015-03-15 199
6 China 2015-02-15 164
7 China 2015-01-15 209
8 China 2015-12-15 24
9 China 2015-11-15 11
10 Russia 2015-03-15 48
11 Russia 2015-02-15 104
12 Russia 2015-01-15 106
13 Russia 2015-12-15 -20
14 Russia 2015-11-15 10
あなたがdf.read_clipboard
を使用して、それを読んでいまし方法これらのデリミタと行セパレータをすべて手動で削除する必要はありませんか?
これは、---+----
でない場合、sep
またはdelimiter
を使用すると簡単になりました。
これは面白いです...私は解決策を見つけることを試みるでしょう... – MaxU