This file contains hidden or 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
| from IPython.display import HTML | |
| HTML('''<script> | |
| code_show=true; | |
| function code_toggle() { | |
| if (code_show){ | |
| $('div.input').hide(); | |
| } else { | |
| $('div.input').show(); | |
| } |
This file contains hidden or 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
| In [26]: s | |
| first second third | |
| bar doo one 0.404705 | |
| two 0.577046 | |
| baz bee one -1.715002 | |
| two -1.039268 | |
| foo bop one -0.370647 | |
| two -1.157892 | |
| qux bop one -1.344312 |
This file contains hidden or 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= pd.DataFrame(np.random.randn(10,4)) | |
| df[4]= [[df[2][x],df[3][x]] for x in range(df.shape[0])] |
This file contains hidden or 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
| // trim from start | |
| static inline std::string <rim(std::string &s) { | |
| s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); | |
| return s; | |
| } | |
| // trim from end | |
| static inline std::string &rtrim(std::string &s) { | |
| s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); | |
| return s; |
NewerOlder