e547a82c24b37c157bc9b40d2724a7b1fd0a7b0f,cesium/featurize.py,,save_featureset,#,346

Before Change


    path : str
        Path to store feature data.
    
    features, channels = zip(*fset.columns)
    for v in [fset.values, features, channels] + list(kwargs.values()):
        if np.array(v).dtype == np.object:
            raise ValueError("Cannot save objects in .npz format.")
    np.savez(path, values=fset.values, index=fset.index.values.astype(str),

After Change


            // Change type of indices from object to str
            for i, (name, dt) in enumerate(dt_list):
                if dt.endswith("O"):
                    size = max(len(x) for x in arr["index"])
                    dt_list[i] = (name, "U" + str(size))
            kwargs[k] = arr.astype(dt_list)

    // Bypass savez to allow for `allow_pickle` keyword
    // See https://github.com/numpy/numpy/pull/5770
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: cesium-ml/cesium
Commit Name: e547a82c24b37c157bc9b40d2724a7b1fd0a7b0f
Time: 2017-04-17
Author: brettnaul@gmail.com
File Name: cesium/featurize.py
Class Name:
Method Name: save_featureset


Project Name: explosion/thinc
Commit Name: 6799144620411f23c3a15abae1f78c5bc2a4f7c0
Time: 2020-01-19
Author: honnibal+gh@gmail.com
File Name: thinc/backends/ops.py
Class Name: Ops
Method Name: pad


Project Name: explosion/thinc
Commit Name: 2eef369b7ac92e38f81819307a4af4238fd953ee
Time: 2020-01-19
Author: honnibal+gh@gmail.com
File Name: thinc/backends/jax_ops.py
Class Name: JaxOps
Method Name: pad