[SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (FINAL)
[SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (FINAL)

### What changes were proposed in this pull request?
It's part of the Pyspark docstrings improvement series (https://github.com/apache/spark/pull/37592, https://github.com/apache/spark/pull/37662, https://github.com/apache/spark/pull/37686, https://github.com/apache/spark/pull/37786, https://github.com/apache/spark/pull/37797, https://github.com/apache/spark/pull/37850)

In this PR I mainly covered missing parts in the docstrings adding some more examples where it needed.

I have also made all examples self explanatory by providing DataFrame creation command where it was missing for clarity to a user.

This should complete "my take" on `functions.py` docstrings & example improvements.

### Why are the changes needed?
To improve PySpark documentation

### Does this PR introduce _any_ user-facing change?
Yes, documentation

### How was this patch tested?
```
PYTHON_EXECUTABLE=python3.9 ./dev/lint-python
./python/run-tests --testnames pyspark.sql.functions
bundle exec jekyll build
```

Closes #37988 from khalidmammadov/docstrings_funcs_part_8.

Authored-by: Khalid Mammadov <16da34b68a005cb90eeefd58c8a727f48828b7a4@gmail.com>
Signed-off-by: Sean Owen <d519fa33a62684a61ab04b24d26f83452d51b34c@gmail.com>

vinodkc/spark,apache/spark,ueshin/apache-spark,zzcclp/spark,holdenk/spark,srowen/spark,holdenk/spark,vinodkc/spark,wangyum/spark,witgo/spark,HyukjinKwon/spark,dongjoon-hyun/spark,dongjoon-hyun/spark,wangyum/spark,witgo/spark,wangyum/spark,zzcclp/spark,mahak/spark,srowen/spark,wangyum/spark,wangyum/spark,shaneknapp/spark,apache/spark,apache/spark,ueshin/apache-spark,shaneknapp/spark,HyukjinKwon/spark,dongjoon-hyun/spark,ueshin/apache-spark,hvanhovell/spark,witgo/spark,HyukjinKwon/spark,ueshin/apache-spark,hvanhovell/spark,vinodkc/spark,holdenk/spark,ueshin/apache-spark,witgo/spark,hvanhovell/spark,hvanhovell/spark,vinodkc/spark,dongjoon-hyun/spark,vinodkc/spark,vinodkc/spark,wangyum/spark,dongjoon-hyun/spark,zzcclp/spark,apache/spark,srowen/spark,srowen/spark,apache/spark,dongjoon-hyun/spark,HyukjinKwon/spark,holdenk/spark,mahak/spark,hvanhovell/spark,hvanhovell/spark,zzcclp/spark,mahak/spark,hvanhovell/spark,witgo/spark,HyukjinKwon/spark,HyukjinKwon/spark,vinodkc/spark,apache/spark,mahak/spark,zzcclp/spark,dongjoon-hyun/spark,shaneknapp/spark,mahak/spark,apache/spark,HyukjinKwon/spark,zzcclp/spark,srowen/spark,mahak/spark,wangyum/spark,mahak/spark,shaneknapp/spark,shaneknapp/spark,ueshin/apache-spark,holdenk/spark,witgo/spark,holdenk/spark,witgo/spark,zzcclp/spark,ueshin/apache-spark,holdenk/spark,shaneknapp/spark,srowen/spark,shaneknapp/spark,srowen/spark