bscheibel 5 anni fa
parent
commit
18b764b5d0
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      merge_pandas.py

+ 3 - 2
merge_pandas.py

@@ -1,4 +1,5 @@
 import pandas
 df = pandas.read_csv('text.csv', header = 0, delimiter=";")
-df['Total'] = df.groupby(['x'])['Text'].transform('sum')
-df.drop_duplicates()
+df['Total'] = df.groupby(['x','y'])['Text'].transform('sum')
+df.drop_duplicates()
+print(df)