8000 REF: remove Block.concat_same_type by jbrockmendel · Pull Request #33486 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content
8000

REF: remove Block.concat_same_type #33486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Apr 15, 2020
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
cb8f6c6
REF: reshape.concat operate on arrays, not SingleBlockManagers
jbrockmendel Mar 29, 2020
5fe3348
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 30, 2020
2a2c9e7
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 30, 2020
2e774f2
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 31, 2020
e008f40
xfail more selectively
jbrockmendel Mar 31, 2020
a244f15
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 4, 2020
9d52e7e
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 6, 2020
3f0ee1b
Revert PandasArray.astype patch
jbrockmendel Apr 6, 2020
2da47de
DOC: Fix examples in `pandas/core/strings.py` (#33328)
ShaharNaveh Apr 6, 2020
9585a41
DOC: do not include type hints in signature in html docs (#33312)
jorisvandenbossche Apr 6, 2020
ed862c0
BUG: DataFrame fail to construct when data is list and columns is nes…
charlesdong1991 Apr 6, 2020
c57f6e7
API/CLN: simplify CategoricalBlock.replace (#33279)
jbrockmendel Apr 6, 2020
2b322d2
REF: BlockManager.delete -> idelete (#33332)
jbrockmendel Apr 6, 2020
d4d7538
TST: Don't use 'is' on strings to avoid SyntaxWarning (#33322)
rebecca-palmer Apr 6, 2020
e3eb29c
CLN: remove fill_tuple kludge (#33310)
jbrockmendel Apr 6, 2020
fcfa7c4
TST: misplaced reduction/indexing tests (#33307)
jbrockmendel Apr 6, 2020
7a468b0
BUG: Don't raise on value_counts for empty Int64 (#33339)
dsaxton Apr 6, 2020
0a2b9cd
REGR: Fix bug when replacing categorical value with self (#33292)
dsaxton Apr 6, 2020
5a38119
Pass method in __finalize__ (#33273)
TomAugspurger Apr 6, 2020
4f1fb46
DOC: Added an example for each series.dt field accessor (#33259)
ShaharNaveh Apr 6, 2020
8150c11
BUG: Timestamp+- ndarray[td64] (#33296)
jbrockmendel Apr 6, 2020
9585ae4
BUG: 2D indexing on DTA/TDA/PA (#33290)
jbrockmendel Apr 6, 2020
c05d28b
REF: dispatch TDBlock.to_native_types to TDA._format_native_types (#3…
jbrockmendel Apr 6, 2020
047e5d7
REF: put concatenate_block_managers in internals.concat (#33231)
jbrockmendel Apr 6, 2020
0e382f2
TST: Add tests for duplicated and drop_duplicates (#32575)
mproszewska Apr 6, 2020
717662b
Ods loses spaces 32207 (#33233)
detrout Apr 6, 2020
9c1984c
PERF: masked ops for reductions (min/max) (#33261)
jorisvandenbossche Apr 6, 2020
efce8fc
REF: do concat on values, avoid blocks
jbrockmendel Apr 7, 2020
362e86c
CLN: Clean nanops.get_corr_func (#33244)
dsaxton Apr 7, 2020
3ad2110
[DOC]: Mention default behaviour of index_col in readcsv (#32977)
bharatr21 Apr 7, 2020
629d7c5
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 7, 2020
859327d
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 8, 2020
87c1006
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 10, 2020
3a84357
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 10, 2020
3ee8363
Remove Block.concat_same_type
jbrockmendel Apr 11, 2020
9e6c7ed
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 11, 2020
fd7c72e
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 11, 2020
41d6da0
use concat_compat
jbrockmendel Apr 11, 2020
5d567f0
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 12, 2020
2e070ca
combine cases
jbrockmendel Apr 12, 2020
9b6d3ac
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 13, 2020
858658a
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Apr 14, 2020
675a948
Dummy commit to force CI
jbrockmendel Apr 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
10000
Diff view
Prev Previous commit
Next Next commit
CLN: Clean nanops.get_corr_func (#33244)
  • Loading branch information
dsaxton authored and jbrockmendel committed Apr 7, 2020
commit 362e86c4a1ae46748e56112fb68c4d15de1570dc
43 changes: 23 additions & 20 deletions pandas/core/nanops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,30 +1332,33 @@ def nancorr(


def get_corr_func(method):
if method in ["kendall", "spearman"]:
from scipy.stats import kendalltau, spearmanr
elif method in ["pearson"]:
pass
elif callable(method):
return method
else:
raise ValueError(
f"Unknown method '{method}', expected one of 'kendall', 'spearman'"
)
if method == "kendall":
from scipy.stats import kendalltau

def func(a, b):
return kendalltau(a, b)[0]

def _pearson(a, b):
return np.corrcoef(a, b)[0, 1]
return func
elif method == "spearman":
from scipy.stats import spearmanr

def _kendall(a, b):
# kendallttau returns a tuple of the tau statistic and pvalue
rs = kendalltau(a, b)
return rs[0]
def func(a, b):
return spearmanr(a, b)[0]

def _spearman(a, b):
return spearmanr(a, b)[0]
return func
elif method == "pearson":

_cor_methods = {"pearson": _pearson, "kendall": _kendall, "spearman": _spearman}
return _cor_methods[method]
def func(a, b):
return np.corrcoef(a, b)[0, 1]

return func
elif callable(method):
return method

raise ValueError(
f"Unknown method '{method}', expected one of "
"'kendall', 'spearman', 'pearson', or callable"
)


@disallow("M8", "m8")
Expand Down
0