Git Product home page Git Product logo

bookrepo's Introduction

Code for Practical Time Series Analysis

Welcome. This git repository contains some (but not all) code that you will encounter in Practical Time Series Analysis. Over time this repository will expand to cover more of the material from the book and also to include extra examples.

Comments and corrections are welcome. Please either submit a pull request or contact me via email at author's first name [DOT] A (my middle initial) [DOT] author's last name at gmail.

I would also mention that much of the work on this book relates to earlier tutorials I have given. I link below to some YouTube videos showing these tutorials.

General tutorials:
Relevant special interest tutorials:

Thanks for taking a look and thanks for your patience as I build out this repo. ~ Aileen

bookrepo's People

Contributors

davale88 avatar skillmananalyticsllc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bookrepo's Issues

How to install `perf`?

In chapter 10, there is import perf but I can't figure out how to install this

pip install perf does not install the adequate package...

Ch04 "Doing the Work Yourself": typo in code

I'm having fun reading your book and found a small typo (the code does not acctually appear in your GitHub repo, though).

In fact, the function open_rate_with_factor_change defined on p.123 does not work as expected. One way to fix this is to change the following code:

    num_opened = np.zeros(len(period_rng))
    for prd in range(0, len(period_rng), 2): 
        try:
            n, p = NUM_EMAILS_SENT_WEEKLY, np.random.uniform(0,
                                                             1)
            num_opened[prd: (prd + 2)] = np.random.binomial(n, p,
                                                            2)
            p = max(min(1, p * fac), 0)
        except:
            num_opened[prd] = np.random.binomial(n, p, 1)

into something like:

    num_opened = np.zeros(len(period_rng))
    n, p = NUM_EMAILS_SENT_WEEKLY, np.random.uniform(0,
                                                     1)
    for prd in range(0, len(period_rng), 2): 
        try:
            num_opened[prd: (prd + 2)] = np.random.binomial(n, p,
                                                            2)
            p = max(min(1, p * fac), 0)
        except:
            num_opened[prd] = np.random.binomial(n, p, 1)

The point here is that random sampling of the probability p should occur outside of the for loop, in order for the increasing or decreasing of email open rate acctually takes place.

About perf library

I have

import perf

in ch10 ForecastingElectricity.ipynb etc, but now it is not in PyPI either, and I get the error when I do pip install perf.

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
ERROR: Could not find a version that satisfies the requirement perf (from versions: none)
ERROR: No matching distribution found for perf

Has this been replaced by another name, or is it no longer in service?

If you don't mind, please let me know the solution or alternative.

Invalid comparison between dtype=period[W-SUN] and Timestamp

I'm using pd.version '1.0.1'

With reference to the file "Ch02/generateAggregateData.py", I'm getting an error for the code below:

line 103, user_rng = rng[rng > join_date]

TypeError: Invalid comparison between dtype=period[W-SUN] and Timestamp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.