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

LinDat file bug #15

Open
jmineau opened this issue Aug 5, 2024 · 1 comment
Open

LinDat file bug #15

jmineau opened this issue Aug 5, 2024 · 1 comment

Comments

@jmineau
Copy link
Owner

jmineau commented Aug 5, 2024

LinDat file seems to be having a bug:

AttributeError: 'DataFrame' object has no attribute 'Time_UTC'

@jmineau
Copy link
Owner Author

jmineau commented Aug 5, 2024

idk kinda seems like it was just my dev version that had a bug... but im not sure why I would have changed the parse method to this:

    def parse(self) -> pd.DataFrame:
        """
        Parse a Lin data file.

        Returns
        -------
        pd.DataFrame
            The parsed data.
        """
        vprint(f'Parsing {os.path.relpath(self.path, DATA_DIR)}')

        instrument, lvl = self.path.split(os.sep)[-3:-1]

        names = DATA_CONFIG[instrument][lvl]['col_names']

        data = pd.read_csv(self.path, on_bad_lines='skip',
                           names=names)

        # Format time col
        data.rename(columns={'TIMESTAMP': 'Time_UTC'}, inplace=True)
        data['Time_UTC'] = pd.to_datetime(data.Time_UTC, errors='coerce',
                                          format='ISO8601')

        return data

leaving open for now...

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

No branches or pull requests

1 participant