In creating data frame

when i was creating
dataframe df=pd.DataFame(y_test,columns=[“y”] )
and than convert it into csv file ,the csv file that i get is empty file with column name y.

But when i pass parameter df=pd.DataFame(y_test )
than it creates dataframe with y_test values why this happen??

is there any other way to give column name?

hey @lgoyal50_be19 ,
can you please let me know what y_test is here.

because both the commands you used are correct and should work.
But still you want to move on ,
then just use code
df.columns = ['y']
after your second command.