This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df[['A','B','C']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pd.set_option('display.max_columns', 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pd.reset_option('all') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df1[~df1.package_req_id.str.get(0).isin(['Y'])] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cols = list(df1) | |
cols.insert(0, cols.pop(cols.index('return_datetime'))) #3rd | |
cols.insert(0, cols.pop(cols.index('order_datetime'))) #2nd | |
cols.insert(0, cols.pop(cols.index('package_req_id'))) #1st | |
df1 = df1.ix[:, cols] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pd.set_option('display.max_columns', 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pd.reset_option('all') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####Temporary solution | |
from IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:100% !important; }</style>")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flattenHierarchicalCol(col,sep = '_'): | |
if not type(col) is tuple: | |
return col | |
else: | |
new_col = '' | |
for leveli,level in enumerate(col): | |
if not level == '': | |
if not leveli == 0: | |
new_col += sep | |
new_col += level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jupyter nbconvert --to notebook --execute testipynb.ipynb --output testipynb.ipynb | |
nbconvert ~/shared/projects/CallCenterHiringFC/code/rates_calculations.ipynb --to script |
OlderNewer