Python Forum
How to create a dataframe from timestamp values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create a dataframe from timestamp values
#2
date_cols = ['CLOSE', 'D_MONTH', 'OPEN']
gbl = globals()
for i in date_cols:
    gbl[i] = pd.to_timedelta(min(data_frame_1[i]), unit='s') + pd.datetime(1960, 1, 1)
I am getting the output as below
Output:
>OPEN Out[520]: Timestamp('1993-02-12 00:00:00') >CLOSE Out[522]: Timestamp('2009-04-30 00:00:00') >D_MONTH Out[523]: Timestamp('2018-01-01 00:00:00')
But I want the output like below as a dataframe not as a timestamp:
Output:
Attr Min_Date CLOSE 2009-04-30 00:00:00 OPEN 1993-02-12 00:00:00 D_MONTH 2018-01-01 00:00:00
Reply


Messages In This Thread
RE: How to create a dataframe from timestamp values - by MohanReddy - Mar-18-2019, 02:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  attempt to split values from within a dataframe column mbrown009 8 2,428 Apr-10-2023, 02:06 AM
Last Post: mbrown009
  Remove specific values from dataframe jonah88888 0 1,732 Sep-24-2021, 05:09 AM
Last Post: jonah88888
  update values in one dataframe based on another dataframe - Pandas iliasb 2 9,387 Aug-14-2021, 12:38 PM
Last Post: jefsummers
  How do I create permutations and combinations of a set of values? pythonforumuid 2 2,529 Sep-13-2020, 12:38 AM
Last Post: pythonforumuid
  Filter data based on a value from another dataframe column and create a file using lo pawanmtm 1 4,315 Jul-15-2020, 06:20 PM
Last Post: pawanmtm
  Assigning Column nunique values to another DataFrame column Pythonito 0 1,742 Jun-25-2020, 05:04 PM
Last Post: Pythonito
  Create dataframe through Dictionary in pandas ift38375 2 2,268 Aug-11-2019, 01:09 AM
Last Post: boring_accountant
  Splitting values in column in a pandas dataframe based on a condition hey_arnold 1 4,196 Jul-24-2018, 02:18 PM
Last Post: hey_arnold
  Improve segmentation : Create sphere brush to edit voxels values in scanners image wi LauraLaura 1 2,600 Jul-19-2018, 12:43 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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