代码之家  ›  专栏  ›  技术社区  ›  Starbucks

Spyder中的截断输出

  •  0
  • Starbucks  · 技术社区  · 6 年前

    我试图查看111365 x 21的数据帧的摘要统计信息。但是我只收到它的截断版本。

    举个例子:

    import pandas as pd
    from urllib.request import urlopen
    from scipy.stats.mstats import mode, gmean, hmean
    numpy.set_printoptions(threshold=numpy.nan)
    
    url = "https://www.ndbc.noaa.gov/view_text_file.php?filename=42040h2015.txt.gz&dir=data/historical/stdmet/"
    data_csv = urlopen(url)
    df2015 = pd.read_csv(data_csv, delim_whitespace=True, index_col=0, parse_dates=True)
    
    df2015.description()
    

                      YY             MM    ...          VIS      TIDE
    count  111365.000000  111365.000000    ...     104801.0  104801.0
    mean     2016.881363       6.190203    ...         99.0      99.0
    std         0.963173       2.748956    ...          0.0       0.0
    min      2014.000000       1.000000    ...         99.0      99.0
    25%      2016.000000       4.000000    ...         99.0      99.0
    50%      2017.000000       6.000000    ...         99.0      99.0
    75%      2018.000000       9.000000    ...         99.0      99.0
    max      2018.000000      12.000000    ...         99.0      99.0
    
    [8 rows x 18 columns]
    

    我要看全部18列。

    import numpy
    numpy.set_printoptions(threshold=numpy.nan)
    # And / or
    pd.set_option('display.max_colwidth', -1)
    

    任何帮助都将不胜感激。谢谢。

    1 回复  |  直到 6 年前
        1
  •  0
  •   Starbucks    6 年前

    pd.set_option('display.expand_frame_repr', False)