How it works...

Step 1 lists the frequencies of all the different data types. Alternatively, you may use the dtypes attribute to get the exact data type for each column. The select_dtypes method takes a list of data types in its include parameter and returns a DataFrame with columns of just those given data types. The list values may be either the string name of the data type or the actual Python object.

The filter method selects columns by only inspecting the column names and not the actual data values. It has three mutually exclusive parameters, items, like, and regex, only one of which can be used at a time. The like parameter takes a string and attempts to find all the column names that contain that exact string somewhere in the name. To gain more flexibility, you may use the regex parameter instead to select column names through a regular expression. This particular regular expression, d, represents all digits from zero to nine and matches any string with at least a single digit in it.

Regular expressions are character sequences that represent search patterns to be used to select different parts of the text. They allow for very complex and highly specific pattern matching.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.107.25