-
Notifications
You must be signed in to change notification settings - Fork 9
Chen-Buynak submission #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yunluyingying
wants to merge
9
commits into
lyy005:master
Choose a base branch
from
yunluyingying:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bccff3d
yy change
mbuynak 67653f5
Yingying add
yunluyingying c87854a
Fav movies change
mbuynak da0673a
Yingying Exercise_4_1
yunluyingying 26efec2
Yingying Chen_1
yunluyingying a8cfd83
question_2
mbuynak 5f7df7c
question-2
mbuynak 80c5165
question_2&3
yunluyingying 5d295d4
codes
yunluyingying File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #Question 1 | ||
| grep -E 'female|male' wages.csv|cut -d ',' -f 1-2|sed 's/,/ /g'|sort -k 1,1 -k 2,2n -u>exercise_4_1.txt | ||
| #Question 2 | ||
| #the gender, yearsExerince, wage for the highest earner | ||
| echo "gender, yearsExerince, wage for the highest earner" > stdout.txt | ||
| grep -E 'female|male' wages.csv|cut -d ',' -f 1,2,4|sed 's/,/ /g'|sort -k 3 -n|tail -n 1 >> stdout.txt | ||
| #the gender, yearsExerince, wage for the lowest earner | ||
| echo "gender, yearsExerince, wage for the lowest earner" >> stdout.txt | ||
| grep -E 'female|male' wages.csv|cut -d ',' -f 1,2,4|sed 's/,/ /g'|sort -k 3 -n|head -n 1 >> stdout.txt | ||
| #the number of females in the top ten earners | ||
| echo "the number of females in the top ten earners" >> stdout.txt | ||
| grep -E 'female|male' wages.csv|cut -d ',' -f 1,2,4|sed 's/,/ /g'|sort -k 3 -n|tail -n 10|grep -E 'female'|wc -l >> stdout.txt | ||
| #Question 3 | ||
| echo "yearsExperience vs minimum_wage" >> stdout.txt | ||
| grep -E 'female|male' wages.csv|cut -d ',' -f 3,4|sed 's/,/ /g'|sort -k 1,1 -k 2,2n|sort -buk1,1|sed -n -e 3p -e 7p >> stdout.txt | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| female 1 | ||
| female 2 | ||
| female 3 | ||
| female 4 | ||
| female 5 | ||
| female 6 | ||
| female 7 | ||
| female 8 | ||
| female 9 | ||
| female 10 | ||
| female 11 | ||
| female 12 | ||
| female 13 | ||
| female 14 | ||
| female 15 | ||
| female 16 | ||
| male 2 | ||
| male 3 | ||
| male 4 | ||
| male 5 | ||
| male 6 | ||
| male 7 | ||
| male 8 | ||
| male 9 | ||
| male 10 | ||
| male 11 | ||
| male 12 | ||
| male 13 | ||
| male 14 | ||
| male 15 | ||
| male 16 | ||
| male 17 | ||
| male 18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| Harry Potter | ||
| Shashank Redemption | ||
| Hunger Games | ||
| Lala land | ||
| Gone girl | ||
| Zootopia |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| 1. Shashank Redemption | ||
| 2. Harry Potter | ||
| 3. Hunger Games | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| gender, yearsExerince, wage for the highest earner | ||
| male 5 39.808917197 | ||
| gender, yearsExerince, wage for the lowest earner | ||
| female 9 0.07655561 | ||
| the number of females in the top ten earners | ||
| 2 | ||
| yearsExperience vs minimum_wage | ||
| 12 0.1028907398 | ||
| 16 4.184513117 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
| cat wages.csv|grep -E 'female|male' wages.csv|cut -d ',' -f 1,2,4|sed 's/,/ /g'|sort -k 3 -n|tail -n -10|grep -E 'female'|wc -l | ||
|
|
||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the bc command for calculation:
minHS=$(cat wages.csv | cut -d "," -f 3,4 | tr "," " " | grep -w 12 | sort -n -k 2 | head -n 1 | cut -d " " -f 2)
minBS=$(cat wages.csv | cut -d "," -f 3,4 | tr "," " " | grep -w 16 | sort -n -k 2 | head -n 1 | cut -d " " -f 2)
echo "$minBS - $minHS" | bc