Issue
This may be a stupid question, but....
when setting options after importing pandas I set them one at a time such as:
pd.set_option('max_rows',1000)
pd.set_option('notebook_repr_html',False)
Is there any way to try and combine them. I tried passing a list of options but no worky.
Not a biggy if there is only one way to do it.
Solution
There isn't a native way to do multiple options on one line. I guess you could do something like:
List comprehension
[pd.set_option(option, setting) for option, setting in [('max_rows', 1000), ('notebook_repr_html', False)]]
but I wouldn't recommend doing that!
Longhand (one command per row)
I think writing this longhand is easier to read, more concise, and more pythonic:
pd.set_option('max_rows',1000)
pd.set_option('notebook_repr_html',False)
Answered By - Andy Hayden
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.