
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
PERF: DataFrame.round() unnecessarily slow copared to np.round() · Issue #17254 · pandas-dev/pandas
Description:
Code Sample, a copy-pastable example if possible import pandas as pd import numpy as np np_df = np.random.randn(10000, 4000) df = pd.DataFrame(np_df) %timeit np.round(np_df, 2) # 416 ms ± 10.2 ms per loop (mean ± std. dev. of 7 runs, 1 l...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {📚}
- Technology & Computing
- Video & Online Content
- Business & Finance
Content Management System {📝}
What CMS is github.com built with?
Github.com relies on WORDPRESS.
Traffic Estimate {📈}
What is the average monthly size of github.com audience?
🚀🌠 Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,634,073 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {💸}
Subscription Packages {💳}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {💰}
Subscription Packages {💳}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,306,274 paying customers.
The estimated monthly recurring revenue (MRR) is $22,286,351.
The estimated annual recurring revenues (ARR) are $267,436,208.
Wordpress Themes and Plugins {🎨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {🔍}
loop, jreback, performance, sign, perf, dataframeround, unnecessarily, slow, copared, npround, timeit, std, dev, runs, gfyoung, milestone, lithomas, pandas, code, projects, issue, numpy, decimals, added, navigation, pull, requests, actions, security, closed, description, aberres, import, showed, major, rounding, data, frame, objects, rounded, fasterrounddf, memory, execution, speed, commented, column, block, difficulty, intermediate, effort,
Topics {✒️}
pull-requests personal information perf unnecessarily slow copared complete data frame underlying data frame quick test showed numpy performance type projects pd import numpy projects milestone import pandas milestone lithomas1 pandas objects lithomas1 mentioned major hotspot milestone relationships return pd copy-pastable series objects def faster_round %timeit faster_round good question get_values method returns ndarray df = pd %timeit np code %timeit df github perf rounded = np columns=df index=df implement round block dev showed numpy np np_df df columns index implement rounded sign dataframe round skip jump
Payment Methods {📊}
- Braintree
Questions {❓}
- Already have an account?
Schema {🗺️}
DiscussionForumPosting:
context:https://schema.org
headline:PERF: DataFrame.round() unnecessarily slow copared to np.round()
articleBody:#### Code Sample, a copy-pastable example if possible
```python
import pandas as pd
import numpy as np
np_df = np.random.randn(10000, 4000)
df = pd.DataFrame(np_df)
%timeit np.round(np_df, 2)
# 416 ms ± 10.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit df.round(2)
# 1.69 s ± 27.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit np.round(df, 2)
# 1.74 s ± 112 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```
#### Problem description
Completely unexpected DataFrage.round() showed up as a major hotspot during profiling.
When looking at the code, we see that even when rounding the complete data frame to a given number of decimals it is split into series objects which are then rounded.
I am wondering if there is a reason not to pass the underlying data frame to numpy and do the rounding there in this case.
A quick test showed that something like this would give us the numpy performance:
```python
def faster_round(df, decimals):
rounded = np.round(df.values, decimals)
return pd.DataFrame(rounded, columns=df.columns, index=df.index)
%timeit faster_round(df, 2)
# 417 ms ± 14.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
author:
url:https://github.com/aberres
type:Person
name:aberres
datePublished:2017-08-15T06:54:35.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:2
url:https://github.com/17254/pandas/issues/17254
context:https://schema.org
headline:PERF: DataFrame.round() unnecessarily slow copared to np.round()
articleBody:#### Code Sample, a copy-pastable example if possible
```python
import pandas as pd
import numpy as np
np_df = np.random.randn(10000, 4000)
df = pd.DataFrame(np_df)
%timeit np.round(np_df, 2)
# 416 ms ± 10.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit df.round(2)
# 1.69 s ± 27.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit np.round(df, 2)
# 1.74 s ± 112 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```
#### Problem description
Completely unexpected DataFrage.round() showed up as a major hotspot during profiling.
When looking at the code, we see that even when rounding the complete data frame to a given number of decimals it is split into series objects which are then rounded.
I am wondering if there is a reason not to pass the underlying data frame to numpy and do the rounding there in this case.
A quick test showed that something like this would give us the numpy performance:
```python
def faster_round(df, decimals):
rounded = np.round(df.values, decimals)
return pd.DataFrame(rounded, columns=df.columns, index=df.index)
%timeit faster_round(df, 2)
# 417 ms ± 14.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
author:
url:https://github.com/aberres
type:Person
name:aberres
datePublished:2017-08-15T06:54:35.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:2
url:https://github.com/17254/pandas/issues/17254
Person:
url:https://github.com/aberres
name:aberres
url:https://github.com/aberres
name:aberres
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:2
interactionType:https://schema.org/CommentAction
userInteractionCount:2
External Links {🔗}(2)
Analytics and Tracking {📊}
- Site Verification - Google
Libraries {📚}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {✉️}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net