How do I expand the output display to see more columns of a Pandas DataFrame?

Update: Pandas 0.23.4 onwards This is not necessary. Pandas autodetects the size of your terminal window if you set pd.options.display.width = 0. (For older versions see at bottom.) pandas.set_printoptions(…) is deprecated. Instead, use pandas.set_option(optname, val), or equivalently pd.options.<opt.hierarchical.name> = val. Like: import pandas as pd pd.set_option(‘display.max_rows’, 500) pd.set_option(‘display.max_columns’, 500) pd.set_option(‘display.width’, 1000) Here is the help … Read more

How to print to stderr in Python?

I found this to be the only one short, flexible, portable and readable: # This line only if you still care about Python2 from __future__ import print_function import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) The optional function eprint saves some repetition. It can be used in the same way as the standard print function: … Read more

What’s the simplest way to print a Java array?

Since Java 5 you can use Arrays.toString(arr) or Arrays.deepToString(arr) for arrays within arrays. Note that the Object[] version calls .toString() on each object in the array. The output is even decorated in the exact way you’re asking. Examples: Simple Array: String[] array = new String[] {“John”, “Mary”, “Bob”}; System.out.println(Arrays.toString(array)); Output: [John, Mary, Bob] Nested Array: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)