fee64903688521ecfce67002e685af2b246bbf97,numerox/report.py,,earn,#Any#Any#,114
Before Change
t2 = df["round"].max()
fmt = "Top earners (R{} - R{}) at {:.2f} usd/nmr"
print(fmt.format(t1, t2, price))
df = df.drop("round", axis=1)
df = df.groupby("user").sum()
profit = df["usd_main"] + df["usd_stake"]
nmr = df["nmr_main"] + df["nmr_stake"] - df["nmr_burn"]
profit += price * nmr
df["profit_usd"] = profit
df = df.sort_values("profit_usd", ascending=False)
if ntop < 0:
df = df[ntop:]
else:
df = df[:ntop]
df = df.round()
cols = ["usd_main", "usd_stake", "nmr_main", "nmr_burn", "profit_usd"]
df[cols] = df[cols].astype(int)
return df
After Change
t2 = df["round"].max()
fmt = "Top earners (R{} - R{}) at {:.2f} usd/nmr"
print(fmt.format(t1, t2, price))
df = df[["user", "usd_main", "usd_stake", "nmr_main", "nmr_stake",
"nmr_burn"]]
df = df.groupby("user").sum()
profit = df["usd_main"] + df["usd_stake"]
nmr = df["nmr_main"] + df["nmr_stake"] - df["nmr_burn"]
profit += price * nmr
df["profit_usd"] = profit
df = df.sort_values("profit_usd", ascending=False)
if ntop < 0:
df = df[ntop:]
else:
df = df[:ntop]
df = df.round()
cols = ["usd_main", "usd_stake", "nmr_main", "nmr_stake", "nmr_burn",
"profit_usd"]
df[cols] = df[cols].astype(int)
return df
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: kwgoodman/numerox
Commit Name: fee64903688521ecfce67002e685af2b246bbf97
Time: 2018-04-26
Author: kwgoodman@gmail.com
File Name: numerox/report.py
Class Name:
Method Name: earn
Project Name: kwgoodman/numerox
Commit Name: 90e63dc840e9d31e80a570ca109c3fbe3012f789
Time: 2018-02-07
Author: kwgoodman@gmail.com
File Name: numerox/numerai.py
Class Name:
Method Name: ten99
Project Name: HDI-Project/ATM
Commit Name: dea98f8e7c2e6c5e37ffb81bc2f52f386bb99a3e
Time: 2017-12-21
Author: bcyphers@mit.edu
File Name: atm/encoder.py
Class Name: DataEncoder
Method Name: transform