Pandas DataFrame: info() function
DataFrame - info() function
The info() function is used to print a concise summary of a DataFrame. This method prints information about a DataFrame including the index dtype and column dtypes, non-null values and memory usage.
DataFrame.info(self, verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None)
|Name||Description||Type / Default Value||Required / Optional|
|verbose||Whether to print the full summary. By default, the setting in pandas.options.display.max_info_columns is followed.||bool||Optional|
|buf||Where to send the output. By default, the output is printed to sys.stdout. Pass a writable buffer if you need to further process the output.||writable buffer
Default Value: defaults to sys.stdout
|max_cols||When to switch from the verbose to the truncated output. If the DataFrame has more than max_cols columns, the truncated output is used. By default, the setting in pandas.options.display.max_info_columns is used.||int||Optional|
|memory_usage||Specifies whether total memory usage of the DataFrame elements (including the index) should be displayed. By default, this follows the pandas.options.display.memory_usage setting.
True always show memory usage. False never shows memory usage. A value of ‘deep’ is equivalent to “True with deep introspection”. Memory usage is shown in human-readable units (base-2 representation). Without deep introspection a memory estimation is made based in column dtype and number of rows assuming values consume the same memory amount for corresponding dtypes. With deep memory introspection, a real memory usage calculation is performed at the cost of computational resources.
|null_counts||Whether to show the non-null counts. By default, this is shown only if the frame is smaller than pandas.options.display.max_info_rows and pandas.options.display.max_info_columns. A value of True always shows the counts, and False never shows the counts.||bool||Optional|
This method prints a summary of a DataFrame and returns None.
Download the Pandas DataFrame Notebooks from here.
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework