49dfdbd2da65978cef30011da0cfa6e0fa0ea334,brian2/importexport/explicit.py,PandasImportExport,export_data,#Any#Any#Any#Any#,40

Before Change


        pandas_data = pd.DataFrame(data)
        // above operation looses information about units so we add it to property
        if units:
            pandas_data.units = [get_unit(data[col]) if type(data[col])==Quantity else None
                                                     for col in pandas_data.columns]
        return pandas_data

    @staticmethod
    def import_data(group, data, units=True, level=0):

After Change


        except ImportError as ex:
            raise ImportError("Exporting to pandas needs a working installation of pandas. "
                              "Importing pandas failed: " + str(ex))
        if units:
            raise NotImplementedError("Units not supported when transforming to pandas")
        // we take adventage of already implemented exporter
        data = DictImportExport.export_data(group, variables,
                                            units=units, level=level)
        pandas_data = pd.DataFrame(data)
        return pandas_data
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: brian-team/brian2
Commit Name: 49dfdbd2da65978cef30011da0cfa6e0fa0ea334
Time: 2016-05-15
Author: raymon92@gmail.com
File Name: brian2/importexport/explicit.py
Class Name: PandasImportExport
Method Name: export_data


Project Name: Scitator/catalyst
Commit Name: 45f7651644f05b413ecd9366e7014edc7f0b8a24
Time: 2019-09-06
Author: scitator@gmail.com
File Name: catalyst/contrib/modules/lama.py
Class Name: LamaPooling
Method Name: __init__