Python Forum
printing maxd = sr.iloc[:1, 1:2]
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
printing maxd = sr.iloc[:1, 1:2]
#1
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.
Gary
Reply
#2
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.
Reply
#3
You probably need the following:
print(maxd.loc[11623, 'rdate'].strftime("%Y-%m-%d"))
(Not tested)
Reply
#4
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']
Gary
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  loc / iloc / ix used with () or [] JoeDainton123 0 1,241 Aug-04-2020, 12:27 PM
Last Post: JoeDainton123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020