![]() ![]() You can use regular expressions with the regex parameter in the filter method. In the above example, the filter method returns columns that contain the exact string 'acid'. The like parameter takes a string as an input and returns columns that has the string. ![]() You can also use the filter method to select columns based on the column names or index labels. The list values can be a string or a Python object. ![]() To select only the float columns, use wine_df.select_dtypes(include = ). The select_dtypes method takes in a list of datatypes in its include parameter. In this example, there are 11 columns that are float and one column that is an integer. To select columns using select_dtypes method, you should first find out the number of columns for each data types. Selecting columns using "select_dtypes" and "filter" methods ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |