question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dtype / checking standardization

See original GitHub issue

In the current specification, there are not standardized data type objects, or a specification as to what a data type object needs to implement: https://data-apis.org/array-api/latest/API_specification/data_types.html

Additionally, there’s no APIs in the specification for checking dtypes, i.e. something like np.issubdtype that is somewhat commonly used in code that would look something like:

def dispatch_based_on_dtype(array):
    if np.issubdtype(array.dtype, np.integer):
        return ...
    elif np.issubdtype(array.dtype, np.floating):
        return ...
    else:
        return ...

cc @jakirkham as I believe this pattern is used quite a bit in Dask which would presumably want to be able to target arbitrary array objects under the hood

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jakirkhamcommented, Apr 2, 2021

FWIW numbers objects are ABC’s so we can just call register on each subclass to add float32 and float64 if subclassing is not an option

0reactions
rgommerscommented, Sep 20, 2022

All the discussion is happening in gh-425 and this is basically a duplicate issue, so I’ll close this again. And we’ll try to finalize gh-425 very soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Standardize Data in Python (With Examples) - Statology
To standardize a dataset means to scale all of the values in the dataset such that the mean value is 0 and the...
Read more >
Is there an efficient method of checking whether a column has ...
Is there a standardized method to swap two variables in Python? ... How to determine whether a column/variable is numeric or not in...
Read more >
Adding Rows to a BDS Dataset: When to Use DTYPE in ...
Another way to check whether DTYPE is being used correctly is to summarize the unique values of. DTYPE without regard to parameter. Most...
Read more >
sklearn.preprocessing.StandardScaler
Standardize features by removing the mean and scaling to unit variance. The standard score of a sample x is calculated as: z =...
Read more >
Preprocessing - Putting it all together | Chan`s Jupyter
Categorical variables and standardization ... Checking column types. Take a look at the UFO dataset's column types using the dtypes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found