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

add python sdk sample #13338

Merged
merged 8 commits into from
Sep 1, 2020
Merged

add python sdk sample #13338

merged 8 commits into from
Sep 1, 2020

Conversation

conhua
Copy link
Member

@conhua conhua commented Aug 26, 2020

No description provided.

|[sample_detect_change_point.py][sample_detect_change_point] |Detecting change points in the entire time series.|

## Prerequisites
* Python 2.7 or 3.x is required to use this package.
Copy link
Member

Choose a reason for hiding this comment

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

3.5 and higher

Choose a reason for hiding this comment

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

done

class DetectChangePointsSample(object):

def detect_change_point(self):
from azure.ai.anomalydetector import AnomalyDetectorClient
Copy link
Member

Choose a reason for hiding this comment

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

This is not recommended to do import inside a function, and this would not look Pythonic to our readers

Choose a reason for hiding this comment

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

done

else:
print(e)

if True in response.is_change_point:
Copy link
Member

Choose a reason for hiding this comment

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

if any(response.is_change_point)

I assume is_change_point is a list of boolean, given the in ?

Choose a reason for hiding this comment

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

done


if True in response.is_change_point:
print('An change point was detected at index:')
for i in range(len(response.is_change_point)):
Copy link
Member

Choose a reason for hiding this comment

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

for i, value in enumerate(response.os_change_point):
    if value:
         print(i)

or

true_values = [i for i, value in enumerate(response.os_change_point) if value]
print(true_values)

Choose a reason for hiding this comment

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

done

@lmazuel lmazuel merged commit 49cc1fe into Azure:master Sep 1, 2020
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Sep 2, 2020
…into link_om_sample

* 'master' of https://github.com/Azure/azure-sdk-for-python: (23 commits)
  Int32 serialization (Azure#13452)
  add output to opinion mining sample (Azure#13494)
  Add Document w/ Eng Sys Checks (Azure#13492)
  update version (Azure#13495)
  Remove resources post test (Azure#13379)
  bing_id -> bing_entity_search_api_id (Azure#13491)
  [EventGrid] Read me + improve docstrings (Azure#13484)
  Build AuthenticationRecords from ADFS identity tokens (Azure#13341)
  Support Subject Name/Issuer authentication (Azure#13350)
  Add KeyVaultAccessControlClient for data plane RBAC (Azure#13372)
  [text analytics] Add redacted_text (Azure#13449)
  add python sdk sample (Azure#13338)
  [text analytics] add versionadded sphinx documentation (Azure#13450)
  [text analytics] add bing_id property to LinkedEntity class (Azure#13446)
  fix typing for paging methods (Azure#13410)
  [text analytics] add domain_filter param (Azure#13451)
  fix issue Azure#11658 for is_valid_resource_id (Azure#11709)
  added create_table_if_not_exists method to table service client (Azure#13385)
  [ServiceBus] Test and failure improvements (Azure#13345)
  Proper encoding and decoding of source URLs - Fixes special characters in source URL issue (Azure#13275)
  ...
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Sep 4, 2020
* add python sample

* add change point

* update anomaly detector sample code

* update readme

* update readme for samples

* update MANIFEST.in

* fix pr

Co-authored-by: yongxingwu <yongxing.wu@microsoft.com>
Co-authored-by: Xia Zhu <zhuxia@microsoft.com>
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Mar 10, 2021
20210304 depth rename network (Azure#13338)

* readme.az.md

* indent

* hide all

* param-name

* use alias
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.

4 participants