Get DataFrame Size as list
IntuitionThe DataFrame.shape attribute provides the dimensions of the DataFrame as a tuple, with the number of rows and columns. Since we need a list containing
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The DataFrame.shape attribute provides the dimensions of the DataFrame as a tuple, with the number of rows and columns. Since we need a list containing these dimensions, we can simply convert the tuple into a list using a one-liner. Given that the tuple always has a fixed size of 2 (rows and columns), the time and space complexity is constant.
# Approach
<!-- Describe your approach to solving the problem. -->
Access the shape attribute of the DataFrame, which returns a tuple (number_of_rows, number_of_columns). Then convert the tuple into a list by iterating over the tuple. Return the list.
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(1)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(1)
# Code
```pythondata []
import pandas as pd

def getDataframeSize(players: pd.DataFrame) -> List[int]:
   return [i for i in players.shape]
```
['Pandas']