Skip to content

Commit

Permalink
fix: improve docstring examples
Browse files Browse the repository at this point in the history
  • Loading branch information
terryyz committed May 9, 2024
1 parent e0641ef commit 4389de5
Show file tree
Hide file tree
Showing 5 changed files with 980 additions and 980 deletions.
8 changes: 4 additions & 4 deletions data/clean/f_111_armel.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def f_111(data_matrix, n_components=2):
>>> import numpy as np
>>> data = np.array([[6, 8, 1, 3, 4], [-1, 0, 3, 5, 1]])
>>> df, ax = f_111(data)
>>> print(df)
Component 1 Component 2 Mean
0 5.700877 2.163271e-16 2.850439
1 -5.700877 2.163271e-16 -2.850439
>>> print(df["Mean"])
0 2.850439
1 -2.850439
Name: Mean, dtype: float64
"""
pca = PCA(n_components=n_components)
transformed_data = pca.fit_transform(data_matrix)
Expand Down
8 changes: 4 additions & 4 deletions data/processed/43_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def task_func(data_matrix, n_components=2):
>>> import numpy as np
>>> data = np.array([[6, 8, 1, 3, 4], [-1, 0, 3, 5, 1]])
>>> df, ax = task_func(data)
>>> print(df)
Component 1 Component 2 Mean
0 5.700877 2.163271e-16 2.850439
1 -5.700877 2.163271e-16 -2.850439
>>> print(df["Mean"])
0 2.850439
1 -2.850439
Name: Mean, dtype: float64
"""
pca = PCA(n_components=n_components)
transformed_data = pca.fit_transform(data_matrix)
Expand Down
8 changes: 4 additions & 4 deletions data/raw/f_111_armel.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def f_111(data_matrix, n_components=2):
>>> import numpy as np
>>> data = np.array([[6, 8, 1, 3, 4], [-1, 0, 3, 5, 1]])
>>> df, ax = f_111(data)
>>> print(df)
Component 1 Component 2 Mean
0 5.700877 2.163271e-16 2.850439
1 -5.700877 2.163271e-16 -2.850439
>>> print(df["Mean"])
0 2.850439
1 -2.850439
Name: Mean, dtype: float64
"""
pca = PCA(n_components=n_components)
transformed_data = pca.fit_transform(data_matrix)
Expand Down
Loading

0 comments on commit 4389de5

Please sign in to comment.