-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: use idiomatic pandas_dtypes in pandas/dtypes/common.py #24541
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
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
c0c87aa
CLN: use idiomatic pandas_dtypes in pandas/dtypes/common.py
jreback f071b20
fix imports
jreback 3e063ba
clean asv
jreback 2e45185
review comments
jreback 9296042
moar clean
jreback 2193f9e
remove extraneous
jreback a4f4cdb
use pandas_dtype
jreback a21164a
isort
jreback dfdc3d2
Merge branch 'master' into dtypes
jreback 8f0a4d3
fix
jreback 420c56a
Merge branch 'master' into dtypes
jreback 33f33e2
Merge branch 'master' into dtypes
jreback abd1620
remove newline
jreback a0aad47
Merge branch 'master' into dtypes
jreback b58cf18
parametrize tests
jreback 7cb889a
add additional types
jreback 86a47a8
simplify issubclass a bit
jreback 7c73269
moar clean
jreback d44b778
remove syntax error
jreback 4e9887e
clean
jreback ee5d70f
Merge branch 'master' into dtypes
jreback d5cd4d6
merge
jreback 6c72ce0
Merge branch 'master' into dtypes
jreback 6781332
Merge branch 'master' into dtypes
jreback fe26970
moar
jreback badb3bc
introspect more types
jreback 8252154
Merge branch 'master' into dtypes
jreback dd518fb
fix
jreback d50fb71
finalize
jreback 0c895f5
remove base
jreback c93a820
Merge branch 'master' into dtypes
jreback f326e37
review
jreback 18030bb
Merge branch 'master' into dtypes
jreback 8294cc1
Merge branch 'master' into dtypes
jreback 70b7b31
Merge branch 'master' into dtypes
jreback 1f1d96b
doc-string
jreback 95ef3ce
update whatsnew
jreback b9f4004
deprecation about MutableMapping
jreback 76d1d86
fix warnings
jreback 8c48457
Update doc/source/whatsnew/v0.24.0.rst
jorisvandenbossche 7ae3cd4
Merge branch 'master' into dtypes
jreback 3111507
Merge remote-tracking branch 'jreback/dtypes' into dtypes
jreback 7d4bd5e
Revert "deprecation about MutableMapping"
jreback File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from pandas.api.types import pandas_dtype | ||
|
||
import numpy as np | ||
from .pandas_vb_common import ( | ||
numeric_dtypes, datetime_dtypes, string_dtypes, extension_dtypes) | ||
|
||
|
||
_numpy_dtypes = [np.dtype(dtype) | ||
for dtype in (numeric_dtypes + | ||
datetime_dtypes + | ||
string_dtypes)] | ||
_dtypes = _numpy_dtypes + extension_dtypes | ||
|
||
|
||
class Dtypes(object): | ||
params = (_dtypes + | ||
list(map(lambda dt: dt.name, _dtypes))) | ||
param_names = ['dtype'] | ||
|
||
def time_pandas_dtype(self, dtype): | ||
pandas_dtype(dtype) | ||
|
||
|
||
class DtypesInvalid(object): | ||
param_names = ['dtype'] | ||
params = ['scalar-string', 'scalar-int', 'list-string', 'array-string'] | ||
data_dict = {'scalar-string': 'foo', | ||
'scalar-int': 1, | ||
'list-string': ['foo'] * 1000, | ||
'array-string': np.array(['foo'] * 1000)} | ||
|
||
def time_pandas_dtype_invalid(self, dtype): | ||
try: | ||
pandas_dtype(self.data_dict[dtype]) | ||
except TypeError: | ||
pass | ||
|
||
|
||
from .pandas_vb_common import setup # noqa: F401 |
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.