There is a built in method which would be the fastest method also, calling tolist
on the .values
np array:
df.values.tolist()
[[0.0, 3.61, 380.0, 3.0],
[1.0, 3.67, 660.0, 3.0],
[1.0, 3.19, 640.0, 4.0],
[0.0, 2.93, 520.0, 4.0]]
More Related Contents:
- How to identify and label similar rows in a pandas data frame
- How to iterate over rows in a DataFrame in Pandas
- Renaming column names in Pandas
- Difference between map, applymap and apply methods in Pandas
- How can I use the apply() function for a single column?
- Pandas filtering for multiple substrings in series
- Filtering Pandas DataFrames on dates
- Python pandas insert list into a cell
- How to replace text in a string column of a Pandas dataframe?
- Combine two pandas Data Frames (join on a common column)
- Pandas DataFrame Groupby two columns and get counts
- Pandas dataframe get first row of each group
- pandas .at versus .loc
- Selection with .loc in python
- Pandas select rows and columns based on boolean condition
- How to flatten a hierarchical index in columns
- Add column to dataframe with constant value
- Pandas get the most frequent values of a column
- Subtract two columns in dataframe
- Python / Pandas – GUI for viewing a DataFrame or Matrix [closed]
- How to do “(df1 & not df2)” dataframe merge in pandas?
- Add a sequential counter column on groups to a pandas dataframe
- How do I assign values based on multiple conditions for existing columns?
- Pandas: Shift down values by one row within a group
- Python Pandas replace NaN in one column with value from corresponding row of second column
- Xticks by pandas plot, rename with the string
- How do you remove the column name row when exporting a pandas DataFrame?
- Remove ends of string entries in pandas DataFrame column
- Collapsing rows in a Pandas dataframe if all rows have only one value in their columns
- Pythonic/efficient way to strip whitespace from every Pandas Data frame cell that has a stringlike object in it