From 5316b0733e4c1624cb58dd80725f09ba02208203 Mon Sep 17 00:00:00 2001 From: Pete Blois Date: Fri, 20 Oct 2023 12:46:29 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 575294449 --- google/colab/_reprs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/colab/_reprs.py b/google/colab/_reprs.py index 8c64c51d..ab38db9b 100644 --- a/google/colab/_reprs.py +++ b/google/colab/_reprs.py @@ -154,7 +154,7 @@ def _dataframe_intrinsic_repr(dataframe): found = True break if not found: - last_line = ip.user_ns['In'][-1] + last_line = ip.user_ns['In'][-1].strip().rpartition('\n')[-1] varname, dot, operator = last_line.partition('.') if varname.isidentifier() and dot and operator.startswith('head('): import pandas as pd