Skip to content

Commit 6a7ff65

Browse files
committed
reformat examples in docs of all functions
1 parent 09b4a59 commit 6a7ff65

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

eda_utils_py/eda_utils_py.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ def imputer(df, strategy="mean", fill_value=None):
2929
3030
Examples
3131
---------
32-
>> import pandas as pd
33-
>> from eda_utils_py import cor_map
32+
>>> import pandas as pd
33+
>>> from eda_utils_py import cor_map
3434
35-
>> data = pd.DataFrame({
36-
>> 'SepalLengthCm':[5.1, 4.9, 4.7],
37-
>> 'SepalWidthCm':[1.4, 1.4, 1.3],
38-
>> 'PetalWidthCm':[0.2, None, 0.2]
39-
>> })
35+
>>> data = pd.DataFrame({
36+
>>> 'SepalLengthCm':[5.1, 4.9, 4.7],
37+
>>> 'SepalWidthCm':[1.4, 1.4, 1.3],
38+
>>> 'PetalWidthCm':[0.2, None, 0.2]
39+
>>> })
4040
41-
>> imputer(data, numerical_columns)
41+
>>> imputer(data, numerical_columns)
4242
SepalLengthCm SepalWidthCm PetalWidthCm
4343
0 5.1 1.4 0.2
4444
1 4.9 1.4 0.2
@@ -107,18 +107,18 @@ def cor_map(dataframe, num_col, col_scheme="purpleorange"):
107107
108108
Examples
109109
---------
110-
>> import pandas as pd
111-
>> from eda_utils_py import cor_map
112-
113-
>> data = pd.DataFrame({
114-
>> 'SepalLengthCm':[5.1, 4.9, 4.7],
115-
>> 'SepalWidthCm':[1.4, 1.4, 1.3],
116-
>> 'PetalWidthCm':[0.2, 0.1, 0.2],
117-
>> 'Species':['Iris-setosa','Iris-virginica', 'Iris-germanica']
118-
>> })
119-
120-
>> numerical_columns = ['SepalLengthCm','SepalWidthCm','PetalWidthCm']
121-
>> cor_map(data, numerical_columns, col_scheme = 'purpleorange')
110+
>>> import pandas as pd
111+
>>> from eda_utils_py import cor_map
112+
113+
>>> data = pd.DataFrame({
114+
>>> 'SepalLengthCm':[5.1, 4.9, 4.7],
115+
>>> 'SepalWidthCm':[1.4, 1.4, 1.3],
116+
>>> 'PetalWidthCm':[0.2, 0.1, 0.2],
117+
>>> 'Species':['Iris-setosa','Iris-virginica', 'Iris-germanica']
118+
>>> })
119+
120+
>>> numerical_columns = ['SepalLengthCm','SepalWidthCm','PetalWidthCm']
121+
>>> cor_map(data, numerical_columns, col_scheme = 'purpleorange')
122122
"""
123123

124124
# Tests whether input data is of pd.DataFrame type
@@ -208,18 +208,18 @@ def outlier_identifier(dataframe, columns=None, method="trim"):
208208
209209
Examples
210210
--------
211-
>> import pandas as pd
212-
>> from eda_utils_py import cor_map
211+
>>> import pandas as pd
212+
>>> from eda_utils_py import cor_map
213213
214214
215-
>> df = pd.DataFrame({
216-
>> 'SepalLengthCm' : [5.1, 4.9, 4.7, 5.5, 5.1, 50, 5.4, 5.0, 5.2, 5.3, 5.1],
217-
>> 'SepalWidthCm' : [1.4, 1.4, 20, 2.0, 0.7, 1.6, 1.2, 1.4, 1.8, 1.5, 2.1],
218-
>> 'PetalWidthCm' : [0.2, 0.2, 0.2, 0.3, 0.4, 0.5, 0.5, 0.6, 0.4, 0.2, 5]
219-
>> })
215+
>>> df = pd.DataFrame({
216+
>>> 'SepalLengthCm' : [5.1, 4.9, 4.7, 5.5, 5.1, 50, 5.4, 5.0, 5.2, 5.3, 5.1],
217+
>>> 'SepalWidthCm' : [1.4, 1.4, 20, 2.0, 0.7, 1.6, 1.2, 1.4, 1.8, 1.5, 2.1],
218+
>>> 'PetalWidthCm' : [0.2, 0.2, 0.2, 0.3, 0.4, 0.5, 0.5, 0.6, 0.4, 0.2, 5]
219+
>>> })
220220
221221
222-
>> outlier_identifier(df)
222+
>>> outlier_identifier(df)
223223
SepalLengthCm SepalWidthCm PetalWidthCm
224224
0 5.1 1.4 0.2
225225
1 4.9 1.4 0.2
@@ -312,19 +312,19 @@ def scale(dataframe, columns, scaler="standard"):
312312
313313
Examples
314314
--------
315-
>> import pandas as pd
316-
>> from eda_utils_py import scale
315+
>>> import pandas as pd
316+
>>> from eda_utils_py import scale
317317
318-
>> data = pd.DataFrame({
319-
>> 'SepalLengthCm':[1, 0, 0, 3, 4],
320-
>> 'SepalWidthCm':[4, 1, 1, 0, 1],
321-
>> 'PetalWidthCm:[2, 0, 0, 2, 1],
322-
>> 'Species':['Iris-setosa','Iris-virginica', 'Iris-germanica']
323-
>> })
318+
>>> data = pd.DataFrame({
319+
>>> 'SepalLengthCm':[1, 0, 0, 3, 4],
320+
>>> 'SepalWidthCm':[4, 1, 1, 0, 1],
321+
>>> 'PetalWidthCm:[2, 0, 0, 2, 1],
322+
>>> 'Species':['Iris-setosa','Iris-virginica', 'Iris-germanica']
323+
>>> })
324324
325-
>> numerical_columns = ['SepalLengthCm','SepalWidthCm','PetalWidthCm']
325+
>>> numerical_columns = ['SepalLengthCm','SepalWidthCm','PetalWidthCm']
326326
327-
>> scale(data, numerical_columns, scaler="minmax")
327+
>>> scale(data, numerical_columns, scaler="minmax")
328328
SepalLengthCm SepalWidthCm PetalWidthCm
329329
0 0.25 1.00 1.0
330330
1 0.00 0.25 0.0

0 commit comments

Comments
 (0)