Assuming df is a DataFrame, which code prints last 5 rows of the DataFrame? df.head(5) df.tail(5) df.sample(5)؟
إجابة الطالب المختصرة من خلال موقع بوابة الإجابات هي
df.tail(5)
The correct code to print the last 5 rows of the DataFrame `df` is:
```python
df.tail(5)
```
Here's why:
* **`df.head(5)`**: This prints the *first* 5 rows of the DataFrame.
* **`df.tail(5)`**: This prints the *last* 5 rows of the DataFrame.
* **`df.sample(5)`**: This prints a random sample of 5 rows from the DataFrame.
اذا كان لديك إجابة افضل او هناك خطأ في الإجابة علي سؤال Assuming df is a DataFrame, which code prints last 5 rows of the DataFrame? df.head(5) df.tail(5) df.sample(5) اترك تعليق فورآ.