reset_option()

We can read display option values and update to different values by using get_option() and set_option()
reset_option()reset one or more option to default value
We can get a list of available options by using describe_option(). These option values we can manage by using set_option() & get_option().

We can reset one option value or reset all the options.

max_rows

By default the value of display option max_rows is 60. We will set this value to 6. After changing the value we can reset this value to its default value by using reset_option().
Let us read our student excel file ( you can download and use ) having 35 rows of data and display the rows after using reset_option()
import pandas as pd 
my_data = pd.read_excel('D:\student.xlsx',index_col='id')
pd.set_option("display.max_rows",6)
print(pd.get_option("display.max_rows")) # 6
pd.reset_option("display.max_rows")
print(my_data)
We will display all 35 rows of data ( not 6 ) as we have used reset_otpion() to restore the default value of max_rows to 60.

Resetting all the display options

pd.reset_option("display")
This will reset all the option values to its default value.

Like this there are several options available and we can update the values of these function. A list of such options with detail description is available by using describe_option()
All display option functions of DataFrame

Pandas read_csv() read_excel() to_excel()
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer