Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| direction | tau | |
|---|---|---|
| 1.0 | 44.17309441579963 | |
| 1.0 | 39.13313136222197 | |
| 1.0 | 2.229445925263579 | |
| 1.0 | 45.51885740055968 | |
| 1.0 | 32.46369490822559 | |
| 0.0 | 34.32693114812909 | |
| 1.0 | 29.851265008411353 | |
| 1.0 | 22.108872716835183 | |
| 0.0 | 39.32300084317585 |
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
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import cps | |
| import seaborn as sns | |
| sns.set_style('white') | |
| plt.ion() | |
| # This is a quick hack that gets the job done :/ | |
| def repulsion(arr): |
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 dplython import * | |
| diamonds >> group_by(X.cut) >> summarize(mean_x = np.mean(X.x), var_y = np.var(X.y)) | |
| diamonds >> group_by(X.cut) >> mutate(mean_x = np.mean(X.x), var_y = np.var(X.y)) |
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
| # R | |
| # 1) Easily create multiple summaries of multiple column. | |
| diamonds %>% | |
| group_by(cut) %>% | |
| summarize(mean_x = mean(x), var_xy = var(x * y)) | |
| # 2) Easily put multiple summaries back into the original data frame | |
| diamonds %>% | |
| group_by(cut) %>% |
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
| import pandas as pd | |
| from ggplot import diamonds | |
| # 1) How do I easily create multiple summaries of multiple columns? | |
| ( | |
| diamonds | |
| .groupby('cut') | |
| .agg(??) # Equivalent of summarize(mean_x = mean(x), var_xy = var(xy)) | |
| ) |