Python Forum

Full Version: printing maxd = sr.iloc[:1, 1:2]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
maxd = sr.iloc[:1, 1:2]
print(maxd)
                    rdate
11623 2019-01-19 07:36:00
All I want to print is 2019-01-19. No rdate, 11623, or 07:36:00

I have spent days with google trying to find the solution with no luck.
You've described your output clearly but I'm not clear on your input, what what library you're implying with the syntax you're using. It's hard to say more at this point, but you might find https://docs.python.org/2/library/dateti...e.strftime useful.
You probably need the following:
print(maxd.loc[11623, 'rdate'].strftime("%Y-%m-%d"))
(Not tested)
Yes I figured it out.
sd.rdate.min().strftime('From: %b %d %y') + '  -  ' + sd.rdate.max().strftime('To: %b %d %y')),
I have trouble when I should use sd.rdate or sd['radte']