首页 > 解决方案 > 如何在 Jenkins 控制台上的数据框中打印单行中的所有列?

问题描述

 I have created a data frame which contains lot of columns:
    
    for eg.
    col1 col2 col3 col4 col4 col5 col6 col7
    
    and each row contains plenty of data in it.
    
    I tried this:

pd.set_option('expand_frame_repr', False)

pd.set_option('display.max_rows', 无)

pd.set_option('display.max_colwidth', 200)

    and in output I am getting:
    
    col1   col2 col3 col4
    col5    col6
    row1   row1 row1 row1
    row1   row1..
    
    
    But I want all this to printed on single line in Jenkins console.
    
    

 col1   col2  col3   col4  col5  col6

 row1   ro1   row1   row1  row1  row1

    
    
    also I see some of the rows which have too much of that comes like row.....
    how can print the full data.

标签: pythonpandasdataframe

解决方案


你可以使用 to_string

print(data_frame[row:row].to_string())

推荐阅读