Azure-docs: 'Derive column by example' date values needs correction

Created on 2 Oct 2018  Â·  8Comments  Â·  Source: MicrosoftDocs/azure-docs

In the section 'Derive column by example' (https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-transform-data#derive-column-by-example), there are a number of prints of the dataset to show the derivation process. In the third of these prints, the dates are listed as

    DATE            date_timerange
30  11/1/2015 22:54     Jan 1, 2015 10PM-12AM
31  11/1/2015 23:54     Jan 1, 2015 10PM-12AM
32  11/1/2015 23:59     Jan 1, 2015 10PM-12AM
33  11/2/2015 0:54      Feb 1, 2015 12AM-2AM

and so on, but I can only assume that this is incorrect and that it should be

    DATE            date_timerange
30  1/1/2015 22:54      Jan 1, 2015 10PM-12AM
31  1/1/2015 23:54      Jan 1, 2015 10PM-12AM
32  1/1/2015 23:59      Jan 1, 2015 10PM-12AM
33  1/2/2015 0:54       Feb 1, 2015 12AM-2AM

and so on. This is also consistent with the fourth print, that looks like this (with the date_timerange column being updated thanks to a new example being added)

    DATE            date_timerange
30  1/1/2015 22:54      Jan 1, 2015 10PM-12AM
31  1/1/2015 23:54      Jan 1, 2015 10PM-12AM
32  1/1/2015 23:59      Jan 1, 2015 10PM-12AM
33  1/2/2015 0:54       Jan 2, 2015 12AM-2AM

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

cxp doc-bug machine-learninsvc triaged

All 8 comments

@ArvidBaa Thanks for the feedback! We are currently investigating and will update you shortly.

Thank you for catching that! It's being updated

@cforbe Thanks for the quick action.

@ArvidBaa We will now proceed to close this thread. If there are further questions regarding this matter, please respond here and @YutongTie-MSFT and we will gladly continue the discussion.

builder = dflow_derive.builders.derive_column_by_example(source_columns=['DATE'], new_column_name='date_timerange')
builder.add_example(source_data=dflow_derive.iloc[1], example_value='Jan 1, 2015 12AM-2AM')
builder.preview(count=5)


AttributeError Traceback (most recent call last)
in
1 builder = dflow_derive.builders.derive_column_by_example(source_columns=['DATE'], new_column_name='date_timerange')
----> 2 builder.add_example(source_data=dflow_derive.iloc[1], example_value='Jan 1, 2015 12AM-2AM')
3 builder.preview(count=5)

AttributeError: 'Dataflow' object has no attribute 'iloc'

builder = dflow.builders.derive_column_by_example(source_columns=['DATE'], new_column_name='date_timerange')
builder.add_example(source_data=dflow.iloc[1], example_value='Jan 1, 2015 12AM-2AM')
builder.preview(count=5)

Should be

df = dflow.head(5)
builder = dflow.builders.derive_column_by_example(source_columns=['DATE'], new_column_name='date_timerange')
builder.add_example(source_data=df.iloc[1], example_value='Jan 1, 2015 12AM-2AM')
builder.preview(count=5)

to avoid the AttributeError: 'Dataflow' object has no attribute 'iloc'

builder = dflow_derive.builders.derive_column_by_example(source_columns=['DATE'], new_column_name='date_timerange')
builder.add_example(source_data=dflow_derive.iloc[1], example_value='Jan 1, 2015 12AM-2AM')
builder.preview(count=5)

AttributeError Traceback (most recent call last)
in
1 builder = dflow_derive.builders.derive_column_by_example(source_columns=['DATE'], new_column_name='date_timerange')
----> 2 builder.add_example(source_data=dflow_derive.iloc[1], example_value='Jan 1, 2015 12AM-2AM')
3 builder.preview(count=5)

AttributeError: 'Dataflow' object has no attribute 'iloc'

or rather

df = dflow.to_pandas_dataframe()

@cforbe FYI

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulmarshall picture paulmarshall  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

Ponant picture Ponant  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments