python
1import pandas as pd 2 3df = pd.read_csv('tsvファイルのpath', delimiter='\t',header=None) 4 5dict = {"text": sentences_value,"pos":pos_value} 6 7df_output= pd.DataFrame.from_dict(dict) 8 9print(df_output) 10# text pos 11#0 they PRP 12#1 see VBN 13#2 the DT 14#3 top NN 15#4 of IN 16#5 the DT 17#6 mountain NN 18#7 . . 19 20 21df_output.to_csv('tsvファイルのpath',sep='\t',header=None) 22
これを出力すると、
0 they PRP
1 see VBN
2 the DT
3 top NN
4 of IN
5 the DT
6 mountain NN
7 . .
このようにmountainの部分でインデントがずれてしまいます。
揃えて出力する(上のprint()で出力したように)ためにはどうすべきか教えていただきたいです!!

回答4件
あなたの回答
tips
プレビュー