a70d7c493fdcac1a1e34273c269e18210637b990,pudl/outputs.py,,organize_cols,#Any#Any#,39
Before Change
df: The DataFrame to be re-organized.
cols: The columns to put first, in their desired output ordering.
key_cols = df[cols].copy()
data_cols = df.drop(cols, axis=1)
data_cols = df[df.columns.sort_values()]
out_df = pd.merge(key_cols, data_cols)
return(out_df)
def add_id_cols(df):
After Change
data_cols = [c for c in df.columns.tolist() if c not in cols]
data_cols.sort()
organized_cols = cols + data_cols
return(df[organized_cols])
def add_id_cols(df):
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances Project Name: catalyst-cooperative/pudl
Commit Name: a70d7c493fdcac1a1e34273c269e18210637b990
Time: 2017-11-08
Author: zane.selvans@catalyst.coop
File Name: pudl/outputs.py
Class Name:
Method Name: organize_cols
Project Name: kwgoodman/numerox
Commit Name: de831768952b9676e25d433044f9a34a381e9390
Time: 2017-11-04
Author: kwgoodman@gmail.com
File Name: numerox/report.py
Class Name:
Method Name: load_report
Project Name: J535D165/recordlinkage
Commit Name: ab8de09b399a04885d1e50affde29bbe93134cd9
Time: 2016-04-11
Author: jonathandebruinhome@gmail.com
File Name: recordlinkage/indexing.py
Class Name:
Method Name: _fullindex
Project Name: TheAlgorithms/Python
Commit Name: 179284a41bf265c59913b72d94bee47d7d6b7414
Time: 2019-10-18
Author: 48747984+Hocnonsense@users.noreply.github.com
File Name: data_structures/binary_tree/treap.py
Class Name:
Method Name: insert