Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented reading RI from CSV data for PandasData #36

Merged
merged 9 commits into from
Jun 29, 2021

Conversation

hechth
Copy link
Member

@hechth hechth commented Jun 28, 2021

Fixes #30

Also introduces multiple possible names for the RI column.

@hechth hechth requested a review from maximskorik June 28, 2021 13:47
@@ -44,13 +44,17 @@ def _init_rt_column_info(self):
def _init_ri_column_info(self):
""" Initialize retention index column name and set its position next to the retention time column. """
self._ri_index = 'retention_index'
self._ri_position = self._rt_position + 1
if self._ri_index in self._data.columns:
self._ri_position = self._data.columns.get_loc(self._ri_index)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks nice, I've had no idea something like get_loc existed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only for Pandas data frames. Found it in the documentation here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, I checked it out already :)

@hechth hechth merged commit cd57222 into RECETOX:main Jun 29, 2021
@@ -7,6 +7,7 @@
class PandasData(Data):
""" Class to handle data from filetypes which can be imported into a pandas dataframe. """
_rt_column_names = set(['RT', 'rt', 'rts', 'retention_times', 'retention_time', 'retention', 'time'])
_ri_column_names = set(['RI', 'ri', 'ris', 'retention_indices', 'retention_index', 'kovats', 'retentionindex'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's start a new standard to unite them all🤣

@hechth hechth deleted the 30_pandas_ri branch January 25, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add reading retention indices from PandasData file types
3 participants