I have written a very simple code that creates a pandas data frame. The issue is when I do my column naming ['X','Y'], my column heading X passes itself on to the column containing the index values. This only occurs when you run the code in jupyter environment, initiated in visual code by #%%. When you run the same code in the terminal the results are accurate. Shown in image below. Any ideas why?
#%%
import pandas as pd
from matplotlib import pyplot as plt
data_1 = {'X': [1.0,2.0,3.0], 'Y': [1.0,2.5,3.5]}
df_1 = pd.DataFrame(data_1)
print(df_1)
I have also tried other methods, but the result is the same
data_1 = [(1.0,1.0),(2.0,2.5),(3.0,3.5)]
df_1 = pd.DataFrame(data_1, columns = ['X','Y']

