Bottom Page

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
Quote
#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.
Quote
#3
You probably need the following:
print(maxd.loc[11623, 'rdate'].strftime("%Y-%m-%d"))
(Not tested)
Quote
#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
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  why it's not printing? nickto21 3 71 Yesterday, 12:41 AM
Last Post: scidam
  printing a bytes string Skaperen 2 89 Jul-21-2019, 03:42 AM
Last Post: Skaperen
  Printing lists acooper7 1 164 Jun-17-2019, 09:37 PM
Last Post: Yoriz
  Printing List in one line bharat_s579 6 311 May-26-2019, 08:30 PM
Last Post: perfringo
  list is printing incorrectly.. anna 1 168 May-18-2019, 12:12 PM
Last Post: ichabod801
  no outcome is printing helpme 2 228 Mar-07-2019, 02:15 PM
Last Post: helpme
  Printing Easter date occurrences samsonite 8 455 Mar-06-2019, 11:49 AM
Last Post: samsonite
  dict printing last key,value out of loop anna 6 386 Feb-23-2019, 03:22 AM
Last Post: anna
  tuple printing trouble anna 0 239 Feb-09-2019, 05:24 PM
Last Post: anna
  Printing one thing from a list bidoofis 1 289 Feb-05-2019, 09:02 PM
Last Post: ichabod801

Forum Jump:


Users browsing this thread: 1 Guest(s)