Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9228389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:18:44+00:00 2026-06-18T05:18:44+00:00

I have a DataFrame which contains a lot of intraday data, the DataFrame has

  • 0

I have a DataFrame which contains a lot of intraday data, the DataFrame has several days of data, dates are not continuous.

 2012-10-08 07:12:22            0.0    0          0  2315.6    0     0.0    0
 2012-10-08 09:14:00         2306.4   20  326586240  2306.4  472  2306.8    4
 2012-10-08 09:15:00         2306.8   34  249805440  2306.8  361  2308.0   26
 2012-10-08 09:15:01         2308.0    1   53309040  2307.4   77  2308.6    9
 2012-10-08 09:15:01.500000  2308.2    1  124630140  2307.0  180  2308.4    1
 2012-10-08 09:15:02         2307.0    5   85846260  2308.2  124  2308.0    9
 2012-10-08 09:15:02.500000  2307.0    3  128073540  2307.0  185  2307.6   11
 ......
 2012-10-10 07:19:30            0.0    0          0  2276.6    0     0.0    0
 2012-10-10 09:14:00         2283.2   80   98634240  2283.2  144  2283.4    1
 2012-10-10 09:15:00         2285.2   18  126814260  2285.2  185  2285.6    3
 2012-10-10 09:15:01         2285.8    6   98719560  2286.8  144  2287.0   25
 2012-10-10 09:15:01.500000  2287.0   36  144759420  2288.8  211  2289.0    4
 2012-10-10 09:15:02         2287.4    6  109829280  2287.4  160  2288.6    5
 ......

How can I extract the unique date in the datetime format from the above DataFrame? To have result like [2012-10-08, 2012-10-10]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:18:45+00:00Added an answer on June 18, 2026 at 5:18 am

    If you have a Series like:

    In [116]: df["Date"]
    Out[116]: 
    0           2012-10-08 07:12:22
    1           2012-10-08 09:14:00
    2           2012-10-08 09:15:00
    3           2012-10-08 09:15:01
    4    2012-10-08 09:15:01.500000
    5           2012-10-08 09:15:02
    6    2012-10-08 09:15:02.500000
    7           2012-10-10 07:19:30
    8           2012-10-10 09:14:00
    9           2012-10-10 09:15:00
    10          2012-10-10 09:15:01
    11   2012-10-10 09:15:01.500000
    12          2012-10-10 09:15:02
    Name: Date
    

    where each object is a Timestamp:

    In [117]: df["Date"][0]
    Out[117]: <Timestamp: 2012-10-08 07:12:22>
    

    you can get only the date by calling .date():

    In [118]: df["Date"][0].date()
    Out[118]: datetime.date(2012, 10, 8)
    

    and Series have a .unique() method. So you can use map and a lambda:

    In [126]: df["Date"].map(lambda t: t.date()).unique()
    Out[126]: array([2012-10-08, 2012-10-10], dtype=object)
    

    or use the Timestamp.date method:

    In [127]: df["Date"].map(pd.Timestamp.date).unique()
    Out[127]: array([2012-10-08, 2012-10-10], dtype=object)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dataframe (data) which includes a lot of dates. I want to
I have a dataframe which contains both numeric variables and factors. When moving data
Let's assume that we have a data frame x which contains the columns job
I have a data.frame in R. It contains a lot of data : gene
I have a dataframe which contains some duplicates. I want to sum rows of
I have python pandas dataframe, in which a column contains month name. How can
SQLDF newbie here. I have a data frame which has about 15,000 rows and
I have a pandas dataframe in which one column of text strings contains comma-separated
Using python I have created following data frame which contains similarity values: cosinFcolor cosinEdge
I have a data.frame in which each gene name is repeated and contains values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.