Here's my file( edited with data included.)
import pandas as pd
df = pd.read_csv("test.csv")
print(df)
Here's the result. This dataframe comes up on Pycharm when I print it.
Date Campaign
3/24/20 GA Shoes Search Campaign
3/24/20 GA Shoes Display Campaign
3/24/20 GA Bag Search Campaign
3/24/20 GA Bag Display Campaign
3/24/20 IG Shoes Campaign
3/24/20 IG Bag Campaign
3/24/20 FB Shoes Campaign
3/24/20 FB Bag Campaign
3/24/20 Email Campaign
But then when I created a function to edit my dataframe, it wouldn't come up anymore
def edit():
new = df.loc[df.Campaign.str.startswith("GA")]
return new
print(edit())
I want this to come up as a dataframe:
Date Campaign
3/24/20 GA Shoes Search Campaign
3/24/20 GA Shoes Display Campaign
3/24/20 GA Bag Search Campaign
3/24/20 GA Bag Display Campaign
I tried debugger but only the original df comes up with "View as DataFrame," my new and edited dataframe won't show up. How do i make my edited dataframe show on Pycharm?