D598 Analytic Programming -- Task 1 (Program Planning)
By Shanikwa Haynes
A: FLOWCHART
, B: PSEUDOCODE
1. Begin
2. Import data from the CSV file into a DataFrame
3. Locate duplicate entries in the dataset
4. If duplicates exist:
a. Remove the duplicate entries
5. Group the data by the 'Business State' field
6. For each of the following fields:
- Total Long-term Debt
- Total Equity
- Debt to Equity Ratio
- Total Liabilities
- Total Revenue
- Profit Margin
Do:
a. Calculate the mean
b. Calculate the median
c. Calculate the minimum
d. Calculate the maximum
7. Save these summary statistics in a new DataFrame
8. Check if any Debt to Equity ratios are less than 0:
a. If true, filter and store those entries separately
9. Calculate the Debt to Income ratio (Total Debt / Total Revenue) for each entry
10. Store the new Debt to Income ratios in a new DataFrame
11. Merge the Debt to Income DataFrame with the original dataset
12. End
C1: FLOWCHART EXPLANATION and C2: PSEUDOCODE EXPLANATION
The flowchart and pseudocode presented are tightly aligned, using consistent terminology to
clearly depict the sequence of operations involved in the data processing workflow. Each
pseudocode instruction corresponds directly to a visual element in the flowchart, from the start of
the process to its conclusion. The flowchart begins with importing data and locating duplicate
entries, followed by a decision node—"Duplicates exist?"—which dictates whether the process
should proceed with data cleaning or continue directly to grouping the dataset by the 'Business
State' field. The next steps involve calculating summary statistics for six financial indicators, as
reflected in a single block summarizing statistical computations. These are then saved to a new
DataFrame. Another decision node—"Debt to Equity ratio less than 0?"—accurately represents
By Shanikwa Haynes
A: FLOWCHART
, B: PSEUDOCODE
1. Begin
2. Import data from the CSV file into a DataFrame
3. Locate duplicate entries in the dataset
4. If duplicates exist:
a. Remove the duplicate entries
5. Group the data by the 'Business State' field
6. For each of the following fields:
- Total Long-term Debt
- Total Equity
- Debt to Equity Ratio
- Total Liabilities
- Total Revenue
- Profit Margin
Do:
a. Calculate the mean
b. Calculate the median
c. Calculate the minimum
d. Calculate the maximum
7. Save these summary statistics in a new DataFrame
8. Check if any Debt to Equity ratios are less than 0:
a. If true, filter and store those entries separately
9. Calculate the Debt to Income ratio (Total Debt / Total Revenue) for each entry
10. Store the new Debt to Income ratios in a new DataFrame
11. Merge the Debt to Income DataFrame with the original dataset
12. End
C1: FLOWCHART EXPLANATION and C2: PSEUDOCODE EXPLANATION
The flowchart and pseudocode presented are tightly aligned, using consistent terminology to
clearly depict the sequence of operations involved in the data processing workflow. Each
pseudocode instruction corresponds directly to a visual element in the flowchart, from the start of
the process to its conclusion. The flowchart begins with importing data and locating duplicate
entries, followed by a decision node—"Duplicates exist?"—which dictates whether the process
should proceed with data cleaning or continue directly to grouping the dataset by the 'Business
State' field. The next steps involve calculating summary statistics for six financial indicators, as
reflected in a single block summarizing statistical computations. These are then saved to a new
DataFrame. Another decision node—"Debt to Equity ratio less than 0?"—accurately represents