19 lines
418 B
Python
19 lines
418 B
Python
import pandas as pd
|
|
|
|
# Read the original CSV
|
|
df = pd.read_csv('candle_test.csv')
|
|
|
|
# Convert timestamp to datetime
|
|
df['DateTime'] = pd.to_datetime(df['Timestamp'], unit='ms')
|
|
|
|
# Drop the original timestamp column
|
|
df = df.drop(columns=['Timestamp'])
|
|
|
|
# Reorder columns
|
|
df = df[['DateTime', 'Open', 'High', 'Low', 'Close', 'Volume', 'VolumeCcy']]
|
|
|
|
# Save the new CSV
|
|
df.to_csv('candle_test_converted.csv', index=False)
|
|
|
|
|