Showing posts with the label Arguments in Python

Featured Post

8 Ways to Optimize AWS Glue Jobs in a Nutshell

  Improving the performance of AWS Glue jobs involves several strategies that target different aspects of the ETL (Extract, Transform, Load) process. Here are some key practices. 1. Optimize Job Scripts Partitioning : Ensure your data is properly partitioned. Partitioning divides your data into manageable chunks, allowing parallel processing and reducing the amount of data scanned. Filtering : Apply pushdown predicates to filter data early in the ETL process, reducing the amount of data processed downstream. Compression : Use compressed file formats (e.g., Parquet, ORC) for your data sources and sinks. These formats not only reduce storage costs but also improve I/O performance. Optimize Transformations : Minimize the number of transformations and actions in your script. Combine transformations where possible and use DataFrame APIs which are optimized for performance. 2. Use Appropriate Data Formats Parquet and ORC : These columnar formats are efficient for storage and querying, signif

How to Use Arguments in Real Python Programs

Here are four types of exclusive arguments in python. The arguments are passers to functions. These are Required arguments, Keyword arguments, Default arguments and Variable-length arguments. Here're 4 Important Arguments in Python The arguments supply input to functions . Because these are various types, herein you will know the details and usage of those types. Argument#1: Required arguments Positional arguments are known as  required arguments  and are passed to a function in the correct order. The arguments in the function call should match the number in the function definition. Sample program: def cal(a,b):     """program to calculate sum of 2 numbers"""     sum=a+b     return sum a=int(input("enter 1st number")) b=int(input("enter 2nd number")) print(cal(a,b)) Output enter 1st number 10 enter 2nd number 22 32 ** Process exited - Return Code: 0 ** Press Enter to exit terminal Argument#2: Keyword arguments A default argument is