

# FillWithMode class
<a name="aws-glue-api-pyspark-transforms-FillWithMode"></a>

 `FillWithMode` 変換は、指定した電話番号形式に従って列をフォーマットします。値の一部が同じ場合、タイブレーカーロジックを指定することもできます。例えば、次の値を考えてみます: `1 2 2 3 3 4` 

 `MINIMUM` の modeType の場合、`FillWithMode` はモード値として 2 を返します。modeType が `MAXIMUM` の場合、モードは 3 です。`AVERAGE` の場合、モードは 2.5 です。

## 例
<a name="pyspark-FillWithMode-examples"></a>

```
from awsglue.context import *
from pyspark.sql import SparkSession
from awsgluedi.transforms import *

sc = SparkContext()
spark = SparkSession(sc)

input_df = spark.createDataFrame(
    [
        (105.111, 13.12),
        (1055.123, 13.12),
        (None, 13.12),
        (13.12, 13.12),
        (None, 13.12),
    ],
    ["source_column_1", "source_column_2"],
)

try:
    df_output = data_quality.FillWithMode.apply(
        data_frame=input_df,
        spark_context=sc,
        source_column="source_column_1",
        mode_type="MAXIMUM"
    )
    df_output.show()    
except:
    print("Unexpected Error happened ")
    raise
```

## Output
<a name="pyspark-FillWithMode-output"></a>

 コードの出力は次のようになります。

```
```
+---------------+---------------+
|source_column_1|source_column_2|
+---------------+---------------+
| 105.111| 13.12|
| 1055.123| 13.12|
| 1055.123| 13.12|
| 13.12| 13.12|
| 1055.123| 13.12|
+---------------+---------------+
```
```

 「awsglue.data\$1quality」モジュールからの `FillWithMode` 変換は、「input\$1df」DataFrame に適用されます。これは、`source_column_1` 列の「null」値を、その列の非 null 値からの最大値 (「mode\$1type="MAXIMUM"」) に置き換えます。

 この場合、`source_column_1` 列の最大値は「1055.123」です。したがって、`source_column_1` の「null」値は、出力 DataFrame の「df\$1output」で「1055.123」に置き換えられます。

## 方法
<a name="aws-glue-api-pyspark-transforms-FillWithMode-_methods"></a>
+ [\$1\$1call\$1\$1](#aws-glue-api-pyspark-transforms-FillWithMode-__call__)
+ [適用](#aws-glue-api-crawler-pyspark-transforms-FillWithMode-apply)
+ [名前](#aws-glue-api-crawler-pyspark-transforms-FillWithMode-name)
+ [describeArgs](#aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeArgs)
+ [describeReturn](#aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeReturn)
+ [describeTransform](#aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeTransform)
+ [describeErrors](#aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeErrors)
+ [説明](#aws-glue-api-crawler-pyspark-transforms-FillWithMode-describe)

## \$1\$1call\$1\$1(spark\$1context、data\$1frame、source\$1column、mode\$1type)
<a name="aws-glue-api-pyspark-transforms-FillWithMode-__call__"></a>

 `FillWithMode` 変換は、列内の文字列のケースをフォーマットします。
+ `source_column` - 既存の列の名前。
+ `mode_type` – データ内のタイ値を解決する方法。この値は、`MINIMUM`、`NONE`、`AVERAGE`、または `MAXIMUM` のいずれかである必要があります。

## apply(cls, \$1args, \$1\$1kwargs)
<a name="aws-glue-api-crawler-pyspark-transforms-FillWithMode-apply"></a>

継承元は `GlueTransform` [適用](aws-glue-api-crawler-pyspark-transforms-GlueTransform.md#aws-glue-api-crawler-pyspark-transforms-GlueTransform-apply)。

## name(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-FillWithMode-name"></a>

継承元は `GlueTransform` [名前](aws-glue-api-crawler-pyspark-transforms-GlueTransform.md#aws-glue-api-crawler-pyspark-transforms-GlueTransform-name)。

## describeArgs(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeArgs"></a>

継承元は `GlueTransform` [describeArgs](aws-glue-api-crawler-pyspark-transforms-GlueTransform.md#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeArgs)。

## describeReturn(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeReturn"></a>

継承元は `GlueTransform` [describeReturn](aws-glue-api-crawler-pyspark-transforms-GlueTransform.md#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeReturn)。

## describeTransform(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeTransform"></a>

継承元は `GlueTransform` [describeTransform](aws-glue-api-crawler-pyspark-transforms-GlueTransform.md#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeTransform)。

## describeErrors(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-FillWithMode-describeErrors"></a>

継承元は `GlueTransform` [describeErrors](aws-glue-api-crawler-pyspark-transforms-GlueTransform.md#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeErrors)。

## describe(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-FillWithMode-describe"></a>

継承元は `GlueTransform` [説明](aws-glue-api-crawler-pyspark-transforms-GlueTransform.md#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describe)。