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 numpy as np | |
| import statsmodels.formula.api as smf | |
| from statsmodels.api import add_constant | |
| from statsmodels.sandbox.regression.gmm import IV2SLS | |
| #Load the Panel Study of Income Dynamics (PSID) into a Dataframe | |
| df = pd.read_csv('PSID1976.csv', header=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
| import pandas as pd | |
| from patsy import dmatrices | |
| import numpy as np | |
| import statsmodels.api as sm | |
| import statsmodels.formula.api as smf | |
| import statsmodels.stats.stattools as st | |
| import matplotlib.pyplot as plt | |
| #create a pandas DataFrame for the counts data set | |
| df = pd.read_csv('bike_sharing_dataset_daywise.csv', header=0, parse_dates=['dteday'], infer_datetime_format=True) |
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 numpy as np | |
| import math | |
| from matplotlib import pyplot as plt | |
| #construct the date parser | |
| mydateparser = lambda x: pd.datetime.strptime(x, '%d-%m-%y') | |
| #load the data set into a pandas data frame |
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 matplotlib import pyplot as plt | |
| from statsmodels.tsa.holtwinters import ExponentialSmoothing as HWES | |
| #read the data file. the date column is expected to be in the mm-dd-yyyy format. | |
| df = pd.read_csv('retail_sales_used_car_dealers_us_1992_2020.csv', header=0, infer_datetime_format=True, parse_dates=[0], index_col=[0]) | |
| df.index.freq = 'MS' | |
| #plot the data | |
| df.plot() |
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 matplotlib import pyplot as plt | |
| from statsmodels.regression.linear_model import OLS as OLS | |
| import statsmodels.api as sm | |
| df = pd.read_csv('taiwan_real_estate_valuation_curated.csv', header=0) | |
| y = df['HOUSE_PRICE_PER_UNIT_AREA'] | |
| X = df['HOUSE_AGE_YEARS'] |
We can't make this file beautiful and searchable because it's too large.
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
| Sample_ID,Sample_Date,Beach_Name,Sample_Location,Enterococci_Results,Units_or_Notes | |
| 050514CP13,05/05/2014,MIDLAND BEACH,Center,20.0,MPN/100 ml | |
| 062011GR04,06/20/2011,MANHATTAN BEACH,Left,,Result below detection limit | |
| 072808BH09,07/28/2008,MIDLAND BEACH,Right,28.0,MPN/100 ml | |
| 051214CP36,05/12/2014,SOUTH BEACH,Right,4.0,MPN/100 ml | |
| 081511KB07,08/15/2011,CEDAR GROVE,Left,360.0,MPN/100 ml | |
| 062909KB01,06/29/2009,MANHATTAN BEACH,Left,8.0,MPN/100 ml | |
| 082112KB07,08/21/2012,CEDAR GROVE,Left,20.0,MPN/100 ml | |
| 072015GR06,07/20/2015,MANHATTAN BEACH,Right,,Result below detection limit | |
| 082613CP16,08/26/2013,SOUTH BEACH,Center,12.0,MPN/100 ml |
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 math | |
| import matplotlib.pyplot as plt | |
| from scipy.stats import invweibull | |
| from scipy.stats import norm | |
| import numpy as np | |
| import pandas as pd | |
| #Load the data file | |
| df = pd.read_csv('DOHMH_Beach_Water_Quality_Data.csv', header=0, infer_datetime_format=True, parse_dates=['Sample_Date']) |
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 math | |
| import numpy as np | |
| import statsmodels.api as sm | |
| from statsmodels.base.model import GenericLikelihoodModel | |
| from scipy.stats import poisson | |
| from scipy.stats import binom | |
| from patsy import dmatrices | |
| import statsmodels.graphics.tsaplots as tsa | |
| from matplotlib import pyplot as plt |
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 numpy as np | |
| from matplotlib import pyplot as plt | |
| import random | |
| import math | |
| #initialize the transition matrix P | |
| P=np.array([[0.6,0.4],[0.75,0.25]]) | |
| #initialize pi_0 | |
| pi_0=np.array([0.5, 0.5]) |
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 numpy as np | |
| from matplotlib import pyplot as plt | |
| import statsmodels.api as sm | |
| #Load the PCE and UMCSENT datasets | |
| df = pd.read_csv(filepath_or_buffer='UMCSENT_PCE.csv', header=0, index_col=0, | |
| infer_datetime_format=True, parse_dates=['DATE']) | |
| #Set the index frequency to 'Month-Start' | |
| df = df.asfreq('MS') |
NewerOlder