qteasy/database.py
def merge_file(self, file_name, df):
        """ merge some data stored in df into file_name,

        the downloaded data are stored in df, a pandas DataFrame, that might
        contain more rows and/or columns than the original file.

        if downloaded data contains more rows than original file, the original
        file will be extended to contain more rows of data, those columns that
        are not covered in downloaded data, np.inf will be used to pad missing
        data to identify missing data.

        if more columns are downloaded, the same thing will happen as more rows
        are downloaded.

        :param file_name:
        :param df:
        :return:
        """
        original_df = self.open_file(file_name)
        new_index = df.index
        new_columns = df.columns
        index_expansion = any(index not in original_df.index for index in new_index)
        column_expansion = any(column not in original_df.columns for column in new_columns)
        if index_expansion:
            additional_index = [index for index in new_index if index not in original_df.index]
            combined_index = list(set(original_df.index) | set(additional_index))
            original_df = original_df.reindex(combined_index)
            original_df.loc[additional_index] = np.inf
            original_df.sort_index(inplace=True)

        if column_expansion:
            additional_column = [c for c in new_columns if c not in original_df.columns]
            for col in additional_column:
                original_df[col] = np.inf

        for col in new_columns:
            original_df[col].loc[new_index] = df[col].values
        self.overwrite_file(file_name, original_df)
 merge some data stored in df into file_name,

        the downloaded data are stored in df, a pandas DataFrame, that might
        contain more rows and/or columns than the original file.

        if downloaded data contains more rows than original file, the original
        file will be extended to contain more rows of data, those columns that
        are not covered in downloaded data, np.inf will be used to pad missing
        data to identify missing data.

        if more columns are downloaded, the same thing will happen as more rows
        are downloaded.

        :param file_name:
        :param df:
        :return:
        
merge some data stored in df into file_name,
the downloaded data are stored in df, a pandas DataFrame, that might
contain more rows and/or columns than the original file.

if downloaded data contains more rows than original file, the original
file will be extended to contain more rows of data, those columns that
are not covered in downloaded data, np.inf will be used to pad missing
data to identify missing data.

if more columns are downloaded, the same thing will happen as more rows
are downloaded.
merge some data stored in df into file_name the downloaded data are stored in df a pandas DataFrame that might contain more rows and / or columns than the original file . if downloaded data contains more rows than original file the original file will be extended to contain more rows of data those columns that are not covered in downloaded data np . inf will be used to pad missing data to identify missing data . if more columns are downloaded the same thing will happen as more rows are downloaded .
def merge_file(self, file_name, df):
        original_df = self.open_file(file_name)
        new_index = df.index
        new_columns = df.columns
        index_expansion = any(index not in original_df.index for index in new_index)
        column_expansion = any(column not in original_df.columns for column in new_columns)
        if index_expansion:
            additional_index = [index for index in new_index if index not in original_df.index]
            combined_index = list(set(original_df.index) | set(additional_index))
            original_df = original_df.reindex(combined_index)
            original_df.loc[additional_index] = np.inf
            original_df.sort_index(inplace=True)
        if column_expansion:
            additional_column = [c for c in new_columns if c not in original_df.columns]
            for col in additional_column:
                original_df[col] = np.inf
        for col in new_columns:
            original_df[col].loc[new_index] = df[col].values
        self.overwrite_file(file_name, original_df)
def merge_file ( self , file_name , df ) : original_df = self . open_file ( file_name ) new_index = df . index new_columns = df . columns index_expansion = any ( index not in original_df . index for index in new_index ) column_expansion = any ( column not in original_df . columns for column in new_columns ) if index_expansion : additional_index = [ index for index in new_index if index not in original_df . index ] combined_index = list ( set ( original_df . index ) | set ( additional_index ) ) original_df = original_df . reindex ( combined_index ) original_df . loc [ additional_index ] = np . inf original_df . sort_index ( inplace = True ) if column_expansion : additional_column = [ c for c in new_columns if c not in original_df . columns ] for col in additional_column : original_df [ col ] = np . inf for col in new_columns : original_df [ col ] . loc [ new_index ] = df [ col ] . values self . overwrite_file ( file_name , original_df )
merge some data stored in df into file_name,
the downloaded data are stored in df, a pandas DataFrame, that might
contain more rows and/or columns than the original file.
merge some data stored in df into file_name the downloaded data are stored in df a pandas DataFrame that might contain more rows and / or columns than the original file .
""" merge some data stored in df into file_name,

        the downloaded data are stored in df, a pandas DataFrame, that might
        contain more rows and/or columns than the original file.

        if downloaded data contains more rows than original file, the original
        file will be extended to contain more rows of data, those columns that
        are not covered in downloaded data, np.inf will be used to pad missing
        data to identify missing data.

        if more columns are downloaded, the same thing will happen as more rows
        are downloaded.

        :param file_name:
        :param df:
        :return:
        """
None
self
file_name
None
df
None