0

I have searched a lot for this problem but dint found the answer. similar issue occured here but dint got answer to his question.

i have this csv, it has seconds data in it, but when i use read_csv() the seconds data gets lost, or if we use parse date the seconds gets replaced by zeroes. here's the code:

orderbook = pd.read_csv('orderbook.csv', usecols = ['Nest UpdateTime'], parse_dates = ['Nest UpdateTime'])

outputs the time column as this:

 Nest UpdateTime
2020-06-16 14:51:00
2020-06-16 14:43:00
2020-06-16 14:42:00

while the csv has seconds data, the seconds are getting replaced by zeroes as you can see in the output above.

how do i fix it so that i could get the seconds that are present in csv instead of zeroes? plz help.

Arjun
  • 85
  • 7

1 Answers1

0

Please check again the data. There is no seconds in it. There is just hours and minutes in 2400 format.

Data:

Product Type,Symbol,Buy/Sell,Order Type,Traded Qty,Average Price,Status,Price,TriggerPrice,Nest UpdateTime,Remarks
MIS,ZEEL,BUY,LIMIT,130,164.15,complete,0,164.1,16-06-20 14:51,
MIS,ZEEL,SELL,MARKET,30,162.95,complete,0,0,16-06-20 14:43,
MIS,ZEEL,SELL,MARKET,100,163.55,complete,0,0,16-06-20 14:42,
MIS,ZEEL,BUY,LIMIT,100,164.55,complete,164.55,164.55,16-06-20 13:51, 
MIS,ZEEL,SELL,LIMIT,100,163.5,complete,163.5,0,16-06-20 13:47,
MIS,ZEEL,BUY,LIMIT,100,164.3,complete,164.3,0,16-06-20 13:47,
MIS,ZEEL,SELL,LIMIT,40,164.4,complete,164.4,0,16-06-20 13:31,
MIS,ZEEL,SELL,LIMIT,30,164.65,complete,164.65,0,16-06-20 13:30,
MIS,ZEEL,SELL,LIMIT,30,165.05,complete,165.05,0,16-06-20 13:28,
MIS,INDUSINDBK,BUY,LIMIT,30,489.7,complete,0,489.55,16-06-20 12:27,
MIS,INDUSINDBK,SELL,MARKET,30,489.15,complete,0,0,16-06-20 12:26,
MIS,INDUSINDBK,BUY,MARKET,25,490.8,complete,0,0,16-06-20 12:22,
MIS,INDUSINDBK,SELL,MARKET,25,489.5,complete,0,0,16-06-20 12:21,
  • if you click on the cell in excel, you will find full data with seconds in the formula bar. – Arjun Jul 04 '20 at 13:36
  • No it does not display such data in any cell. The only cell that has any code in formula bar is the first one and clearly you can see that it doesn't contain seconds data – Povilas Kirna Jul 04 '20 at 13:38
  • oh yes, you r right, my code damaged the original file, sorry. – Arjun Jul 04 '20 at 13:45