Skip to content

Commit

Permalink
fixed append to concat
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinesands committed Oct 16, 2023
1 parent 72ba3f6 commit 93ad913
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyIstocsy/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _matchDatasets(self, intensityData, featureMetadata, sampleMetadata):
featureMetadata['Targeted Feature Number'] = featureMetadata['Targeted Feature Number'] + tfn_ix

# Create merged list of all sample IDs
sampleIDs_all = np.unique(self.dataset.sampleMetadata['Sample ID'].append(sampleMetadata['Sample ID']))
sampleIDs_all = np.unique(pandas.concat([self.dataset.sampleMetadata['Sample ID'], sampleMetadata['Sample ID']]))

for sampleID in sampleIDs_all:
ix1 = self.dataset.sampleMetadata[sampleID == self.dataset.sampleMetadata['Sample ID']].index
Expand All @@ -224,7 +224,7 @@ def _matchDatasets(self, intensityData, featureMetadata, sampleMetadata):
self.dataset.sampleMetadata['Sample File Name'] = self.dataset.sampleMetadata['Sample File Name'] + ';' + sampleMetadata['Sample File Name']

# Append new featureMetadata
self.dataset.featureMetadata = self.dataset.featureMetadata.append(featureMetadata, sort=False)
self.dataset.featureMetadata = pandas.concat([self.dataset.featureMetadata, featureMetadata], sort=False)
self.dataset.featureMetadata.reset_index(drop=True, inplace=True)

# Overwrite intensityData
Expand Down Expand Up @@ -294,7 +294,7 @@ def _loadAnnotations(self):

self.annotationData = pandas.DataFrame(None, columns=['Annotation', 'Retention Time', 'm/z', 'ppm'])

self.annotationData = self.annotationData.append(annotationData, sort=False)
self.annotationData = pandas.concat([self.annotationData, annotationData], sort=False)

self.annotationData.reset_index(drop=True, inplace=True)

Expand Down

0 comments on commit 93ad913

Please sign in to comment.