Получить панды для отображения только двух слов из каждой строки будет сложно. Строки в Python на самом деле не имеют понятия отдельных слов. Что вы можете сделать, это разбить каждую строку на список строк (по одной строке на слово), а затем ограничить число элементов списка, которые печатает Pandas, используя параметр 'display.max_seq_items'
:
import pandas as pd
d = ''' Abc XYZ
0 Hello "How are you doing today"
1 Good "This is a job well done"
2 Bye "See you tomorrow"
3 Books "Read chapter 1 to 5 only"'''
df = pd.read_csv(pd.compat.StringIO(d), sep='\s+')
# convert the XYZ values from str to list of str
df['XYZ'] = df['XYZ'].str.split()
# only display the first 2 values in each list of word strings
with pd.option_context('display.max_seq_items', 2):
print(df)
Выход:
Abc XYZ
0 Hello [How, are, ...]
1 Good [This, is, ...]
2 Bye [See, you, ...]
3 Books [Read, chapter, ...]