I have a function that takes the path to CSV file as an argument and adds a column:
def df_change(path):
pd.read_csv(path)
df55 = pd.read_csv(path)
df55['name'] = 'xxx'
print(df55)
But the result I get is Series:
But I need it to be a Dataframe.
I tried to store the result for converting by using this method:
But it didn't work.
I also tried .to_frame(), but I either used it wrong or it can't be applied in my case