bookrepo's Issues
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
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...
Help readers replicate the language environment
Hi, I think it is a good idea to post the environment you are using for the code, such as requirements.txt
for python. Data science library APIs are constantly changing...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.