Posts

Showing posts with the label Complex programs

Featured Post

8 Ways to Optimize AWS Glue Jobs in a Nutshell

Image
  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 Write Complex Python Program Using Functions

Image
Here is an example of complex python program written using functions. Many times, in job interviews, you need to give a written test. There, you may need to answer tricky programs. Historically, people are afraid to take a test.  Especially in python .  Complex Python programs Below are the Complex Python Program Using Functions and examples of how to write the code. Counting lower and upper case letters Creating a list 1. Counting lower and upper case letters Below program counts the upper and lower case letters. def count_lower_upper(s): dlu = {'Lower': 0, 'Upper': 0} for ch in s: if ch.islower(): dlu['Lower'] += 1 elif ch.isupper(): dlu['Upper'] += 1 return(dlu) d = count_lower_upper('James BOnd') print(d) d = count_lower_upper('Anant Amrut Mahalle') print(d) Also read : How to Lose Your Weight 2. Creating a List Here it uses two input lists for creating a new list. Additionall