This file contains 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
mkdir -p | |
cd code | |
curl -s --output banklist.csv https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/banklist.csv | |
touch ca_failed_banks.csv | |
head -1 banklist.csv | |
head -1 banklist.csv > ca_failed_banks.csv | |
cat ca_failed_banks.csv | |
grep CA banklist.csv >> ca_failed_banks.csv | |
ROW_COUNT=`wc -l < ca_failed_banks.csv | xargs` | |
NUM_BANKS=$(($ROW_COUNT - 1)) |
This file contains 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
animals = ['cat', 'dog', 'canary', 'chihuahua', 'narwhal'] | |
filtered_animals = [] | |
for animal in animals: | |
if animal.startswith('c'): | |
print(animal.upper()) | |
filtered_animals.append(animal) | |
print('Number of C-animals: '+str(len(filtered_animals))) |
This file contains 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
~> mkdir code | |
~> cd code | |
~/code> curl -s --output banklist.csv https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/banklist.csv | |
~/code> touch ca_failed_banks.csv | |
~/code> head -1 banklist.csv | |
Bank Name�,City�,State�,Cert�,Acquiring Institution�,Closing Date�,Fund | |
~/code> head -1 banklist.csv > ca_failed_banks.csv | |
~/code> cat ca_failed_banks.csv | |
~/code> grep CA banklist.csv >> ca_failed_banks.csv | |
~/code> ROW_COUNT=`wc -l < ca_failed_banks.csv | xargs` |