Inspectopedia
 
2024.3

Method Series.to_list() is recommended

Warning
New
Last modified: 03 December 2024

Reports redundant list in list(Series.values) statement for pandas and polars libraries. Such Series values extraction can be replaced with the to_list() function call.

Example:

list(df['column'].values)

When the quick-fix is applied, the code changes to:

df['column'].to_list()