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
# Homepage: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.plot.html | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
# plot | |
DF.plot(x='year', y=['var1', 'var2'],kind="line",subplots=False,layout=(2,2)) | |
# layout: distribution of multicharts. | |
# subplots: plot each line in different charts. |
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
""" Filter by condition """ | |
# conditional operators for pandas: | |
# EQUAL: == | |
# DIFFERENT TO: != | |
# BIGGER THAN: > | |
# LOWER THAN: < | |
# BIGGER OR EQUAL TO: >= | |
# LOWER OR EQUEAL TO: <= | |
# AND: & | |
# OR: | |
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
# import modules and tools | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
# SOURCE OF COLOURS: http://matplotlib.org/examples/color/named_colors.html | |
from matplotlib import colors as mcolors | |
lname_colors = mcolors.cnames.keys() | |
# create objects | |
fig, ax = plt.subplots() |
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
import numpy as np | |
import pandas as pd | |
# alternative faster: Pandas on Ray | |
import ray.dataframe as pd | |
## ONE NUMPY ARRAY TO PANDAS DATAFRAME | |
# data | |
ldata = [[1,2],[7,3]] | |
# list of list to numpy array |
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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |