0

I have a minor problem with viewing one variable in a table. I changed data type of "date" from object to datetime64, but now it is displayed on 2 lines.

enter image description here

enter image description here

This is the code I used.

df['date']=pd.to_datetime(df["date"])

Is there a way to make it work on one line?

I tried to widen the "date" column, by setting up the maximum width.

pd.set_option('max_colwidth', None)
Anton Menshov
  • 2,266
  • 14
  • 34
  • 55
viktet
  • 1
  • 1

1 Answers1

0

I think you are asking why the dash breaks the line. In order to force a non-breaking hyphen, replace the normal "-" with this HTML entity:

‑

That is also displayed as a hyphen, but it will not cause a line break.

Thomas
  • 86
  • 5