1
我用下面的代碼:如何在Python中分割數據框中的數據?
import pandas as pd
pandas_bigram = pd.DataFrame(bigram_data)
print pandas_bigram
我得到的輸出如下
0
0 ashoka -**0
1 - wikipedia,**1
2 wikipedia, the**2
3 the free**2
4 free encyclopedia**2
5 encyclopedia ashoka**1
6 ashoka from**2
7 from wikipedia,**1
8 wikipedia, the**2
9 the free**2
10 free encyclopedia**2
我的問題是如何分割該數據幀。所以,我會得到兩行數據。這裏的數據由「**」分隔。
您是否正在閱讀csv文件的bigram_data? –