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

In Docs > getting started: import_csv() #491

Closed
vddo opened this issue Jun 27, 2024 · 1 comment
Closed

In Docs > getting started: import_csv() #491

vddo opened this issue Jun 27, 2024 · 1 comment

Comments

@vddo
Copy link

vddo commented Jun 27, 2024

Hi, I have a question regarding the import_csv function in Getting started > Importing your first event log > Loading csv files.

def import_csv(file_path):
    event_log = pandas.read_csv(file_path, sep=';')
    num_events = len(event_log)
    num_cases = len(event_log.case_id.unique())
    print("Number of events: {}\nNumber of cases: {}".format(num_events, num_cases))

In line 4 (num_cases) how can case_id be an attribute of pandas.DataFrame? Maybe it should look like this:

   num_cases = len(event_log['case_id'].unique())
@fit-alessandro-berti
Copy link
Contributor

Dear @vddo

If the name of the column does not contain strange characters, like in the mentioned situation, then dataframe.case_id is equivalent to dataframe["case_id"]

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

2 participants