Python Forum
How can I do it in Python for this SQL statement?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I do it in Python for this SQL statement?
#1
Hello All,

I would like to ask, I have dataframe like this:

datetime,NO,PG,PART_TIME,COURSE_YEAR
09/02/2018 13:43:42,3035447142,UG,F,2
09/02/2018 13:43:45,3035447142,UG,F,2
09/02/2018 13:43:53,3035533288,UG,F,1
09/02/2018 13:43:53,3035447142,UG,F,2
09/02/2018 13:43:55,3035535169,UG,F,1
...........
...........

I would like to do a SQL statement:
select min(a.datetime),NO,COURSE_YEAR from this_table a group by NO,COURSE_YEAR;

How should I do it in python3.7 (using pandas)?
Thank you very much!
Reply


Messages In This Thread
How can I do it in Python for this SQL statement? - by mmk1995 - Aug-23-2019, 04:49 AM

Forum Jump:

User Panel Messages

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