Cheatography
https://cheatography.com
Cheat sheet focused on finance work with Python for excel.
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Pandas (Data Manipulation)
pd.DataFrame() |
Creates DataFrames from lists, dictionaries, or external data. |
df.loc[] and df.iloc[]: |
Row and column indexing. As a note, iloc is easier to work with, as it calls the "name" of the columns. |
df.groupby(): |
Data grouping by categories. |
df.pivot_table(): |
Creates pivot tables. |
df.merge(): |
Merges two DataFrames. |
df.apply(): |
Applies custom functions to columns. |
df['column].rolling() |
for Moving Windows (Rolling Statistics). Key arguments: window -> Number of periods | min_periods -> min. observations per window |
|
Data Visualization
plt.plot(). Plot lines |
plt.bar(): Creates bar charts. |
plt.hist(): Creates histograms. |
plt.scatter(): Creates scatter plots. |
plt.show(): Displays the plot. |
plt.title("My Chart Title") |
df.plot(kind='insert here whatever your fav chart is, i.e., bar, hist, scatter') |
|
|
|
|
|
|
|