├── .gitignore
├── CONTRIBUTING.md
├── FUNDING.yml
├── LICENSE
├── README.md
├── assets
└── survey-python.png
├── notebooks
├── .vscode
│ └── settings.json
├── datasets
│ └── datasets_691884_1211839_la-riots-deaths.csv
├── images
│ ├── boolean_index.svg
│ ├── broadcasting.png
│ ├── broadcasting.svg
│ ├── copies.svg
│ ├── indexing.png
│ ├── indexing.svg
│ ├── invalid-broadcasting.png
│ ├── invalid-broadcasting.svg
│ ├── numpy-array.png
│ ├── numpy-array.svg
│ ├── numpy-docs-topics.txt
│ ├── survey-python.png
│ ├── vectorization.png
│ └── vectorization.svg
├── intro-jupyter-ide.ipynb
├── intro-numpy-fundamentals.ipynb
├── intro-pandas-fundamentals.ipynb
└── intro-python-fundamentals.ipynb
├── requirements.txt
└── unix-shell
├── a-folder
├── got-characters.txt
└── my-empty-file.txt
├── b-folder
└── a-folder
│ └── got-characters.txt
├── cat
├── catbug.txt
├── characters-folder
├── .hidden-file.txt
├── got-characters-copy.txt
├── got-characters.txt
└── harry-potter-characters.txt
├── empty.txt
├── first-command.txt
├── fruits.txt
├── got-characters-copy.txt
├── got-characters.txt
├── harry-potter-characters.txt
├── my-empty-file-1.txt
├── my-empty-file-2.txt
├── my-empty-file-4.txt
├── terminal-binder.PNG
└── unix_shell.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to contribute to this project
2 |
3 | There are a couple of ways you can contribute to this project:
4 |
5 | - Reporting bugs
6 | - Fixing typos
7 | - Flaging incorrect contents
8 | - Generating alternative formats
9 | - Suggestion new sections and topics
10 |
11 | ## Code bugs
12 |
13 | If you found a code bug and want to help me out fixing it, please follow this [template](https://gist.github.com/carlo/3402842)
14 |
15 | ## Typos
16 |
17 | If ou find typos you want to fix, please submit a pull request describing your correction.
18 |
19 | ## Content correction
20 |
21 | If you find factual errors in the content I presented, please create an issue to discuss its correction.
22 |
23 | ## PDF and other formats generation
24 |
25 | If you want to add a PDF or alternative format for the project content, create an issue first to discuss if I think it will be appropiated.
26 |
27 | ## Suggestions
28 |
29 | If you have suggestions of topics or examples to add, create an issue with "Suggestion" in the subject.
30 |
--------------------------------------------------------------------------------
/FUNDING.yml:
--------------------------------------------------------------------------------
1 | repo: pabloinsente/intro-sc-python
2 | filename: FUNDING.YML
3 |
4 | github: pabloinsente
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Pablo Caceres
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Python Tools for Data Science, Machine Learning and Scientific computing - 2020
2 |
3 | Python is a general purpose programming languague that has become the leader in the [scientific computing and data science landscape](https://towardsdatascience.com/kaggle-user-survey-2019-326e187ff207).
4 |
5 | 
6 | Source: Kaggle Survey 2019
7 |
8 | Python success has been driven primarily because of its **intuitive syntaxis**, **flexibility**, and **extensivility**, meaning that it's easy to learn, it can be used for a wide variety of taks, and incorporating numerical computing libraries written in high-performance languages like C++ and Fortran is straightforward. Additionally, Python benefits from a large and strong community of developers commited to free and open source software.
9 |
10 | Python libraries for Scientific Computing and Data Science are **extensive**, **secure**, and **mature**. Companies like Google, Microsoft, Apple, Dropbox, and Netflix, use Python for several critical applications, in particular the ones based on data processing and machine learning. Companies like Instagram and Youtube were built from the ground up in Python.
11 |
12 | In academia, Python is the facto standard for research and applications in artificial intelligence (AI), machine learning (ML), and big data analysis. All the major frameworks for AI and ML, i.e., [Tensorflow](https://www.tensorflow.org/), [Keras](https://keras.io/), [PyTorch](https://pytorch.org/), and [MXNet](https://mxnet.apache.org/), are based on Python.
13 |
14 | Python also has a continiously growing an strong presence in the Data Visualization field, with libraries like [Matplotlib](https://matplotlib.org/), [Seaborn](https://seaborn.pydata.org/), [Altair](https://altair-viz.github.io/), and [Plotly](https://plotly.com/).
15 |
16 | Python presence in statistics is weaker and less mature than the one of languages like R, STATA, and SPSS. Libraries like [Statsmodels](https://www.statsmodels.org/stable/index.html) and [PyMC3](https://docs.pymc.io/) are in constant development and helping too close the gap between Python and other frameworks. This is not to say that you cannot do statistics in Python. As a matter of fact, you can do absolutely everything that can be done in other languages, but it may requiere more effort or more advance knowledge of Python.
17 |
18 | The two pillars of Scientific Computing and Data Science in Python are **[NumPy](https://numpy.org/)** and **[Pandas](https://pandas.pydata.org/)**. NumPy is a library for numerical computing, particularly matrix-like computation. Pandas is a library for data analysis and data frame manipulation. NumPy and Pandas are commonly used in tandem as the base for any kind of data processing and modeling.
19 |
20 | In this project, I focus in the fundamentals of **NumPy** and **Pandas** for Data Science, Machine Learning, and Scientific Computing in Python. I will also plan to introduce the UNIX shell and Python basics such that you can use NumPy and Pandas effectively.
21 |
22 | If you want to acquire the math fundamentals before approaching Python and its libraries, I am working in a another project which covers that ([here](https://github.com/pabloinsente/math-app-ml)). The Linear Algebra chapters is the most important and can be found [here](https://pabloinsente.github.io/intro-linear-algebra).
23 |
24 | ## Table of contents
25 |
26 | I'll cover the following topics:
27 |
28 | 0. Introduction to the UNIX shell and Bash
29 | 1. Introduction to Jupyter Notebooks: set-up, user-guide, and best practices 
30 | 2. Introduction to Python basics
31 | 3. Introduction to NumPy 
32 | 4. Introduction to Pandas
33 |
34 | The content of each section will be delivered as a Jupyter Notebook and/or Markdown files.
35 |
36 | ## Usage
37 |
38 | There are two alternatives to access the contents: **remote** and **local**.
39 |
40 | The **remote option** does not require any installation or configuration from your part. It is click and play. But, you will have a lot less control over the Python set up, you will probably have to use a slow machine in the cloud, and you won't be able to save and recover anything you change in the Notebooks (you will have to download the Notebooks with the changes). Since this is a begginer workshop, I highly recommend to use this option, as performance and control are not issues at this point.
41 |
42 | The **local option** does require to follow a series of instructions to download and set up everything in your computer. I do provide the code to copy-paste and run in the terminal, but such instructions only work for Linux-based systems, like Macbooks are Linux-machines. If you are a Windows users, you have two options:
43 |
44 | 1. downloading and installing terminal emulators like [GitBash](https://gitforwindows.org/) and [Cygwin](https://www.cygwin.com/)
45 | 2. to install the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
46 |
47 | If you are a beginner, [GitBash](https://gitforwindows.org/) and [Cygwin](https://www.cygwin.com/) should work just fine. I do not advise trying (WSL) unless you feel comfortable with using the terminal.
48 |
49 | ### Option 1: Cloud-based environment (prefered)
50 |
51 | Click in the ```binder``` icon -> [](https://mybinder.org/v2/gh/pabloinsente/intro-sc-python/master/?urlpath=lab)
52 |
53 | This will build an online development environment with the repository contents. Beware that it may take 2-3 minutes to be ready.
54 |
55 | Then navigate to the `notebooks` directory and click on `TURORIAL-NAME.ipynb`
56 |
57 | ### Option 2: Local environment
58 |
59 | To obtain the files locally, run this in the command line:
60 |
61 | ```git
62 | git clone https://github.com/pabloinsente/intro-sc-python.git
63 | ```
64 |
65 | To set up your system, you need Python 3.6 installed in a Linux/Mac machine. Check you have Python installed by running this in the terminal:
66 |
67 | ```bash
68 | python3 --version
69 | ```
70 |
71 | you should see something like
72 |
73 | ```bash
74 | python 3.6.X # the X stands for any number
75 | ```
76 |
77 | If you do not have Python 3.6 installed, go to the [Python website](https://www.python.org/downloads/), search Python 3.6.8 under the "Looking for a specific release?" section, and follow the downloading and installing instructions.
78 |
79 | Once you have Python installed, It is recommended to use a [virtual environment](https://docs.python.org/3/tutorial/venv.html) before installing the dependencies. To do this, navigate into the cloned repository in the console by:
80 |
81 | ```bash
82 | cd intro-sc-python
83 | ```
84 |
85 | Note that you may need to change the path to `cd` into the directory.
86 |
87 | Then run this inside that directory to create the virtual environment:
88 |
89 | ```Python
90 | python3 -m venv venv
91 | ```
92 |
93 | And activate your environment by running:
94 |
95 | ```bash
96 | source venv/bin/activate
97 | ```
98 |
99 | Make sure to have the latest pip version:
100 |
101 | ```bash
102 | pip install --upgrade pip
103 | ```
104 |
105 | Install dependencies by running:
106 |
107 | ```Python
108 | pip install -r requirements.txt
109 | ```
110 |
111 | **To run the notebook**, navigate to the ```notebooks``` directory and launch Jupyter Lab as:
112 |
113 | ```Python
114 | jupyter lab ./notebooks/TURORIAL-NAME.ipynb
115 | ```
116 |
--------------------------------------------------------------------------------
/assets/survey-python.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/assets/survey-python.png
--------------------------------------------------------------------------------
/notebooks/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "python.pythonPath": "/home/pablo/.pyenv/versions/3.6.10/bin/python3"
3 | }
--------------------------------------------------------------------------------
/notebooks/datasets/datasets_691884_1211839_la-riots-deaths.csv:
--------------------------------------------------------------------------------
1 | first,last,Full Name,Solved*,Age,Gender,Race,Date,Address,Neighborhood,status,lat,lon,Map Description,Story,URL
2 | Cesar A.,Aguilar,Cesar A. Aguilar,,18, Male, Latino, 1992-04-30, 2009 W. 6th St.,Westlake,Officer involved shooting,-118.2739756,34.0592814,"Cesar Aguilar, an 18-year-old Latino, was shot and killed Thursday, April 30, 1992, in Westlake.
3 | Aguilar, a Honduran immigrant, was arrested with more than 40 other alleged looters near Sam's Corner Liquor Store at 6th Street and Westlake Avenue. Officers say he was ordered to lie prone, and that he then pulled what appeared to be a gun from his waistband and pointed it toward them.
4 | Officers fired at Aguilar with a 9-millimeter pistol and a shotgun. He was struck in the chest and died at the scene, according to an initial coroner's account.
5 | ","Cesar Aguilar, an 18-year-old Latino, was shot and killed Thursday, April 30, 1992, in Westlake.
6 | Aguilar, a Honduran immigrant, was arrested with more than 40 other alleged looters near Sam's Corner Liquor Store at 6th Street and Westlake Avenue. Officers say he was ordered to lie prone, and that he then pulled what appeared to be a gun from his waistband and pointed it toward them.
7 | Officers fired at Aguilar with a 9-millimeter pistol and a shotgun. He was struck in the chest and died at the scene, according to an initial coroner's account.
8 | The ""gun,"" however, was a plastic toy with a black barrel and brown grips, officials said.
9 | Aguilar had lived for five months in the Park View Luxury Apartments, a $450-a-month hotel at MacArthur Park. Friends said he delivered newspapers for a living.
10 | A father of two, Aguilar had planned to return to Honduras to be reunited with his pregnant girlfriend.
11 | Aguilar's body was flown back to Honduras at that government's expense because Aguilar's family could not pay the $1,976, Consul General Rene Francisco Umana said.
12 | ""It's so sad,"" Umana said. ""Maybe he didn't have an idea to hurt anybody . . . but the situation was so difficult, so grave. In L.A., things can happen.""
13 | ",http://articles.latimes.com/print/1992-06-21/news/mn-1558_1_police-officer
14 | George,Alvarez,George Alvarez,,42, Male, Latino, 1992-05-01,Main & College streets,Chinatown,Not riot-related,-118.2340982,34.0626901,"George Alvarez, a 42-year-old Latino, died Friday, May 1, 1992, in Chinatown. Alvarez was beaten to death by some homeless people after he allegedly stole less than $5 worth of recyclable cans and bottles. His body was found in front of a recycling center, near Main and College streets. ","George Alvarez, a 42-year-old Latino, died Friday, May 1, 1992, in Chinatown. Alvarez was beaten to death by some homeless people after he allegedly stole less than $5 worth of recyclable cans and bottles. His body was found in front of a recycling center, near Main and College streets.",
15 | Wilson ,Alvarez,Wilson Alvarez,Unsolved,40, Male, Latino, 1992-05-23, 3100 Rosecrans Ave.,Hawthorne,Homicide,-118.326816,33.901662,"Wilson Alvarez, a 40-year-old Latino, died of head injuries at County-USC Medical Center on May 23, 1992. According to authorities, Alvarez was assaulted while throwing rocks at looters Friday, May 1.","Wilson Alvarez, a 40-year-old Latino, died of head injuries at County-USC Medical Center on May 23, 1992. According to authorities, Alvarez was assaulted while throwing rocks at looters Friday, May 1.",
16 | Brian E.,Andrew,Brian E. Andrew,,30, Male, Black, 1992-04-30, Rosecrans & Chester avenues,Compton,Officer involved shooting,-118.2153903,33.9034569,"Brian E. Andrew, a 30-year-old black man, was shot and killed Thursday, April 30, 1992, near Rosecrans and Chester avenues in Compton.
17 | Andrew, who worked odd jobs in construction, went out Thursday night and never returned.
18 | After trying in vain to locate her son, Gloria Andrew filed a missing-persons report six days later. The next day, a Compton police officer knocked on her door to tell her the news.
19 | Andrew was seen running from a nearby shoe store with other looters, police said, and was carrying boxes of shoes and a large bottle of beer.
20 | Andrew had dropped the shoes and was waving the bottle when a Compton police officer caught up with him in an alley and shot him once in the face as they grappled, police said.
21 | ","Brian E. Andrew, a 30-year-old black man, was shot and killed Thursday, April 30, 1992, near Rosecrans and Chester avenues in Compton.
22 | Andrew, who worked odd jobs in construction, went out Thursday night and never returned.
23 | After trying in vain to locate her son, Gloria Andrew filed a missing-persons report six days later. The next day, a Compton police officer knocked on her door to tell her the news.
24 | Andrew was seen running from a nearby shoe store with other looters, police said, and was carrying boxes of shoes and a large bottle of beer.
25 | Andrew had dropped the shoes and was waving the bottle when a Compton police officer caught up with him in an alley and shot him once in the face as they grappled, police said.
26 | Andrew, the father of two 14-year-old girls, had had minor run-ins with police, his mother said, and once served six months in the California Youth Authority on an assault conviction.
27 | But she said it was ""inconceivable"" that he would strike an armed officer. ""He wasn't that type of person.""
28 | ",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
29 | Vivian ,Austin,Vivian Austin,,87,Female,Black,5/3/1992,1600 W. 60th St.,Harvard Park,Death,-118.304741,33.985667,"Vivian Austin, an 87-year-old black woman, died Sunday, May 3, 1992, in the 1600 block of West 60th Street. Austin suffered a fatal heart attack at her home in Harvard Park.
30 | Friends said she had been distraught by the rioting.
31 | ""This is considered a riot case because the stress from the riot was well documented and is a contributing factor in death from arteriosclerotic disease,"" the coroner's report says.
32 | ","Vivian Austin, an 87-year-old black woman, died Sunday, May 3, 1992, in the 1600 block of West 60th Street. Austin suffered a fatal heart attack at her home in Harvard Park.
33 | Friends said she had been distraught by the rioting.
34 | ""This is considered a riot case because the stress from the riot was well documented and is a contributing factor in death from arteriosclerotic disease,"" the coroner's report says.
35 | ",
36 | Franklin,Benavidez,Franklin Benavidez,,27,Male,Latino,4/30/1992,4404 S. Western Ave.,Vermont Square,Officer involved shooting,-118.3088215,34.0034731,"Franklin Benavidez, a 27-year-old Latino, was shot and killed Thursday, April 30, 1992, in the 4400 block of South Western Avenue in Vermont Square.
37 | According to authorities, Benavidez was shot after fleeing from a gas station he had tried to rob at Western and Vernon avenues. Benavidez pointed a shotgun at officers after being ordered to drop it, they said.
38 | Two LAPD Metro Division officers fired 10 rounds, investigators said.
39 | A second suspect, Victor Munoz, 19, was struck in the stomach, police said, after he appeared to arm himself with a handgun. Munoz, who was hospitalized for two weeks, was not arrested. Investigators later determined that Munoz was carrying a beer can.","Franklin Benavidez, a 27-year-old Latino, was shot and killed Thursday, April 30, 1992, in the 4400 block of South Western Avenue in Vermont Square.
40 | According to authorities, Benavidez was shot after fleeing from a gas station he had tried to rob at Western and Vernon avenues. Benavidez pointed a shotgun at officers after being ordered to drop it, they said.
41 | Two LAPD Metro Division officers fired 10 rounds, investigators said.
42 | A second suspect, Victor Munoz, 19, was struck in the stomach, police said, after he appeared to arm himself with a handgun. Munoz, who was hospitalized for two weeks, was not arrested. Investigators later determined that Munoz was carrying a beer can.
43 | Munoz said Benavidez did not have a gun and did not try to rob the gas station.
44 | J.C. Wilburn, who operates the Shell station, said two Latino men -- one with a shotgun -- tried to rob his business moments before the shooting, but left when he and two co-workers displayed guns of their own.
45 | Almost immediately after the would-be robbers turned the corner, Wilburn said, gunfire rang out.
46 | Benavidez, who moved to the United States in 1985, was born in El Salvador and had served in the Salvadoran Army. In Los Angeles, he repaired cars and delivered telephone books.
47 | ",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
48 | Carol,Benson,Carol Benson,,42,Female,Black,5/2/1992,Harbor Freeway near Slauson Avenue,South Park,Death,-118.2805037,33.98916756,"Carol Benson, a 42-year-old black woman, was struck on the 110 Freeway near Slauson Avenue in a hit-and-run accident on Saturday, May 2, 1992.
49 | Little is known about Benson, who was struck and dragged 180 feet. Authorities say she lived by herself in an apartment across from a small church in South Los Angeles. No relatives claimed her body, so her funeral was like those offered for all indigents: a cremation at County-USC Medical Center.
50 | ","Carol Benson, a 42-year-old black woman, was struck on the 110 Freeway near Slauson Avenue in a hit-and-run accident on Saturday, May 2, 1992.
51 | Little is known about Benson, who was struck and dragged 180 feet. Authorities say she lived by herself in an apartment across from a small church in South Los Angeles. No relatives claimed her body, so her funeral was like those offered for all indigents: a cremation at County-USC Medical Center.
52 | ",
53 | Patrick,Bettan,Patrick Bettan,Solved,30, Male, White, 1992-04-30, 2740 W. Olympic Blvd.,Koreatown,Homicide,-118.293181,34.052068,"Patrick Bettan, a 30-year-old white man, was shot and killed Thursday, April 30, 1992, in Koreatown. Bettan, a security guard at a Koreatown mini-mall in the 2700 block of West Olympic Boulevard, was accidentally shot by a co-worker during a looting incident.","Patrick Bettan, a 30-year-old white man, was shot and killed Thursday, April 30, 1992, in Koreatown. Bettan, a security guard at a Koreatown mini-mall in the 2700 block of West Olympic Boulevard, was accidentally shot by a co-worker during a looting incident.",http://articles.latimes.com/print/1992-06-21/news/mn-1558_1_police-officer
54 | Hector,Castro,Hector Castro,Unsolved,49, Male, Latino, 1992-04-30, Vermont & Leeward avenues,Koreatown,Homicide,-118.291654,34.0587022,"Hector Castro, a 49-year-old Latino, was shot and killed Thursday, April 30, 1992, in Koreatown.
55 | Castro was shot outside a block of retail shops at Vermont and Leeward avenues by an unknown gunman during a looting melee. The fatal bullet passed through the Central American immigrant's neck and was never found, authorities said.
56 | ""There were 150 to 300 people out there,"" said LAPD Det. Steven Sena. ""Not only were there Korean merchants shooting their weapons to scare off looters, but possible gang members and looters were shooting at the Koreans to get them out of the stores.""
57 | ""It makes the case almost impossible"" to solve, Sena said.
58 |
59 | ","Hector Castro, a 49-year-old Latino, was shot and killed Thursday, April 30, 1992, in Koreatown.
60 | Castro was shot outside a block of retail shops at Vermont and Leeward avenues by an unknown gunman during a looting melee. The fatal bullet passed through the Central American immigrant's neck and was never found, authorities said.
61 | ""There were 150 to 300 people out there,"" said LAPD Det. Steven Sena. ""Not only were there Korean merchants shooting their weapons to scare off looters, but possible gang members and looters were shooting at the Koreans to get them out of the stores.""
62 | ""It makes the case almost impossible"" to solve, Sena said.
63 | ",
64 | Jerel L.,Channell,Jerel L. Channell,,26,Male,Black,4/30/1992,Santa Monica Boulevard & Seward Street,Hollywood,Death,-118.3323783,34.09129756,"Darnell R. Mallory, an 18-year-old black man, Jerel L. Channell, a 26-year-old black man, and Juanita Pettaway, a 37-year-old black woman, were killed in an auto accident Thursday, April 30, 1992, in Hollywood.
65 | The trio fled after Beverly Hills police officers noticed a defective taillight on their car and tried to stop them. After a high-speed chase down side streets, their car jumped a curb and crashed into a wall at Santa Monica Boulevard and Seward Street.
66 | An investigation showed that the three had robbed a man of his wallet in West Los Angeles. ""We have no reason to believe this was anything more than a common street robbery,"" said police.
67 | ""This is considered a riot case because of the riot-related robbery,"" the coroner's report says.
68 | ","Darnell R. Mallory, an 18-year-old black man, Jerel L. Channell, a 26-year-old black man, and Juanita Pettaway, a 37-year-old black woman, were killed in an auto accident Thursday, April 30, 1992, in Hollywood.
69 | The trio fled after Beverly Hills police officers noticed a defective taillight on their car and tried to stop them. After a high-speed chase down side streets, their car jumped a curb and crashed into a wall at Santa Monica Boulevard and Seward Street.
70 | An investigation showed that the three had robbed a man of his wallet in West Los Angeles. ""We have no reason to believe this was anything more than a common street robbery,"" said police.
71 | ""This is considered a riot case because of the riot-related robbery,"" the coroner's report says.
72 | ",
73 | Gregory,Davis Jr.,Gregory Davis Jr.,Unsolved,15, Male, Black, 1992-04-30, Vermont Avenue & 43rd Street,Vermont Square,Homicide,-118.2915492,34.005485,"Gregory Davis Jr., a 15-year-old black teen, was fatally shot Wednesday, April 29, 1992, near the intersection of Vermont Avenue and 43rd Street in Vermont Square. He was transported by friends to County-USC Medical Center, where he died.","Gregory Davis Jr., a 15-year-old black teen, was fatally shot Wednesday, April 29, 1992, near the intersection of Vermont Avenue and 43rd Street in Vermont Square. He was transported by friends to County-USC Medical Center, where he died.",http://articles.latimes.com/print/1992-06-21/news/mn-1558_1_police-officer
74 | John,Doe #80,John Doe #80,Unsolved, None, Male, White, 1992-05-02,5800 block of South Vermont Avenue,Vermont-Slauson,Homicide,-118.2914954,33.98939885,"John Doe #80 was found Saturday, May 2, 1992, in a burned-out Pep Boys auto parts store in the 5800 block of South Vermont Avenue. The store in Vermont-Slauson had been torched a few days earlier.
75 | Investigators succeeded in lifting a single print from the body's left middle finger -- a critical piece of information in the identification process. In addition, they X-rayed the body's teeth and recovered from the scene a pair of blue bikini underwear, a .38-caliber bullet casing and parts of a pair of blue jeans.
76 | ","John Doe #80 was found Saturday, May 2, 1992, in a burned-out Pep Boys auto parts store in the 5800 block of South Vermont Avenue. The store in Vermont-Slauson had been torched a few days earlier.
77 | Investigators succeeded in lifting a single print from the body's left middle finger -- a critical piece of information in the identification process. In addition, they X-rayed the body's teeth and recovered from the scene a pair of blue bikini underwear, a .38-caliber bullet casing and parts of a pair of blue jeans.
78 | ",http://articles.latimes.com/print/1992-09-10/news/mn-326_1_unidentified-bodies
79 | Harry,Doller,Harry Doller,,56,Male,White,5/1/1992,3500 block of Winslow Drive,Silver Lake,Not riot-related,-118.278763,34.08778849,"Harry Doller, a 56-year-old white man, died Friday, May 1, 1992, in Silver Lake. Doller, who lived alone in a cottage in the 3500 block Winslow Drive, ""fell asleep with a cigarette and his bed caught fire,"" said Det. Andrew Cicoria.
80 | The coroner's office concluded that he died of a drug and alcohol overdose and that his cigarette may have started the fire.
81 | ","Harry Doller, a 56-year-old white man, died Friday, May 1, 1992, in Silver Lake. Doller, who lived alone in a cottage in the 3500 block Winslow Drive, ""fell asleep with a cigarette and his bed caught fire,"" said Det. Andrew Cicoria.
82 | The coroner's office concluded that he died of a drug and alcohol overdose and that his cigarette may have started the fire.
83 | ",
84 | Kevin J.,Edwards,Kevin J. Edwards,,35, Male, Black, 1992-04-30, 614 S. Locust Ave.,Compton,Not riot-related,-118.2002522,33.892421,"Kevin Edwards, a 35-year-old black man, was shot and killed Thursday, April 30, 1992, in the 600 block of South Locust Avenue in Compton. Edwards was shot after an apparent argument with a friend at a home far from the scene of any disturbances. ""It may have been a domestic dispute,"" said Det. John Swanson.","Kevin Edwards, a 35-year-old black man, was shot and killed Thursday, April 30, 1992, in the 600 block of South Locust Avenue in Compton. Edwards was shot after an apparent argument with a friend at a home far from the scene of any disturbances. ""It may have been a domestic dispute,"" said Det. John Swanson.",
85 | Howard,Epstein,Howard Epstein,Unsolved,45, Male, White, 1992-04-30, Slauson & 7th avenues,Hyde Park,Homicide,-118.3247424,33.9890486,"Howard Epstein, a 45-year-old white man, was shot and killed Thursday, April 30, 1992, near Slauson and 7th avenues in Hyde Park.
86 | Epstein, who had flown from his Northern California home to check on his South Los Angeles metal manufacturing business, was struck in the head by a bullet that apparently came from a pickup truck that had pulled alongside his car.
87 | His car careened into a liquor store parking lot, where a crowd quickly gathered. Onlookers broke into applause when someone yelled that the dead driver was white, witnesses said, and Epstein's cellular telephone, camera, briefcase and pistol were stolen.
88 | Hostility was so intense after the shooting of Epstein that detectives towed away the Epstein's Thunderbird while his body was still behind the wheel -- an unusual step.
89 | ","Howard Epstein, a 45-year-old white man, was shot and killed Thursday, April 30, 1992, near Slauson and 7th avenues in Hyde Park.
90 | Epstein, who had flown from his Northern California home to check on his South Los Angeles metal manufacturing business, was struck in the head by a bullet that apparently came from a pickup truck that had pulled alongside his car.
91 | His car careened into a liquor store parking lot, where a crowd quickly gathered. Onlookers broke into applause when someone yelled that the dead driver was white, witnesses said, and Epstein's cellular telephone, camera, briefcase and pistol were stolen.
92 | Hostility was so intense after the shooting of Epstein that detectives towed away the Epstein's Thunderbird while his body was still behind the wheel -- an unusual step.
93 | ",http://articles.latimes.com/print/1992-06-21/news/mn-1558_1_police-officer
94 | Juana,Espinosa,Juana Espinosa,Solved,65, Female, Latino, 1992-05-02, 7608 S. Compton Ave.,Compton,Homicide,-118.2461881,33.9198205,"Juana Espinosa, a 65-year-old Latina, was shot and killed Saturday, May 2, 1992, in the 7600 block of South Compton Avenue in Willowbrook. Espinosa was shot in the stomach by a 15-year-old boy who authorities say was aiming for two other youths.","Juana Espinosa, a 65-year-old Latina, was shot and killed Saturday, May 2, 1992, in the 7600 block of South Compton Avenue in Willowbrook. Espinosa was shot in the stomach by a 15-year-old boy who authorities say was aiming for two other youths.",
95 | Kevin A.,Evanahen,Kevin A. Evanahen,Unsolved,24, Male, White, 1992-05-01, Braddock Drive & Inglewood Boulevard,Del Rey,Homicide,-118.4144533,33.99267241,"Kevin A. Evanahen, a 24-year-old white man, died Friday, May 1, 1992, in Del Rey. Evanahen fell through the roof of a check-cashing store at Braddock Drive and Inglewood Avenue while trying to put out a fire.","Kevin A. Evanahen, a 24-year-old white man, died Friday, May 1, 1992, in Del Rey. Evanahen fell through the roof of a check-cashing store at Braddock Drive and Inglewood Avenue while trying to put out a fire.",
96 | Jose L.,Garcia,Jose L. Garcia,,15, Male, Latino, 1992-04-30, 1005 S. Fresno St. ,Boyle Heights,Not riot-related,-118.2070419,34.0275527,"Jose L. Garcia, a 15-year-old Latino, was shot and killed Thursday, April 30, 1992, in the 1000 block of South Fresno Street in Boyle Heights. Garcia died from a gunshot wound to the chest, reportedly after a fight. His death may have been gang-related. ","Jose L. Garcia, a 15-year-old Latino, was shot and killed Thursday, April 30, 1992, in the 1000 block of South Fresno Street in Boyle Heights. Garcia died from a gunshot wound to the chest, reportedly after a fight. His death may have been gang-related. ",
97 | Mark,Garcia,Mark Garcia,,15, Male, Latino, 1992-04-30,10700 block of Burin Avenue,Lennox,Officer involved shooting,-118.3537656,33.93895407,"Mark Garcia, a 15-year-old Latino youth, was shot and killed Thursday, April 30, 1992, in Lennox.","Mark Garcia, a 15-year-old Latino youth, was shot and killed Thursday, April 30, 1992, in Lennox.
98 | Friends said he was drawn by curiosity to the looting and fires in a mini-mall at Hawthorne Boulevard and 101st Street but did not participate.
99 | An initial Sheriff's Department report alleged that Mark was one of four jewelry shop looters who fled in a black Ford Tempo and engaged in a shootout with Deputies Wayne Beckley and Jeffrey Moore.
100 | The suspected looters bailed out of their car six blocks away. Deputies caught up with them in a nearby parking lot and returned fire, killing Mark.
101 | The boy turned out to be unarmed. Witnesses, including two youths in the Tempo, have told The Times that Mark had not been in the car with them.
102 | Sheriff's investigators later confirmed that Mark was already at the parking lot when the looting suspects arrived and was shot while fleeing with them from deputies.
103 | ",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
104 | Elias,Garcia Rivera,Elias Garcia Rivera,Solved,32, Male, Latino, 1992-12-16, 12834 Vanowen St.,Valley Glen,Homicide,-118.4137912,34.1939342,"Elias Garcia Rivera, a 32-year-old Latino, died Dec. 16, 1992, at St. Joseph Medical Center in Burbank. He had been in critical condition with a fractured skull for nearly eight months. Garcia had been struck at the base of the skull during an altercation on Wednesday, April 29, at an apartment complex in the 12800 block of Vanowen Street in Valley Glen.
105 | On Oct. 25, 1993, Traville J. Craig, 19, was convicted of first-degree murder and sentenced to life in prison.
106 | ","Elias Garcia Rivera, a 32-year-old Latino, died Dec. 16, 1992, at St. Joseph Medical Center in Burbank. He had been in critical condition with a fractured skull for nearly eight months. Garcia had been struck at the base of the skull during an altercation on Wednesday, April 29, at an apartment complex in the 12800 block of Vanowen Street in Valley Glen.
107 | On Oct. 25, 1993, Traville J. Craig, 19, was convicted of first-degree murder and sentenced to life in prison.
108 | ",http://articles.latimes.com/print/1993-10-26/local/me-49859_1_murder-charge
109 | Andreas,Garnica,Andreas Garnica,,36, Male, Latino, 1992-04-30, 2034 W. Pico Blvd.,Pico-Union,Not riot-related,-118.2818793,34.0468443,"Andreas Garnica, a 36-year-old Latino, was stabbed to death Thursday, April 30, 1992, in Pico-Union. Garnica was attacked in the 2000 block of West Pico Boulevard during a drug deal and street robbery.
110 | Detectives were unable to find the family of Adolfo Morales, also known as Andres J. Garnica, until they received a lead through a wire service reporter's inquiry.
111 | ","Andreas Garnica, a 36-year-old Latino, was stabbed to death Thursday, April 30, 1992, in Pico-Union. Garnica was attacked in the 2000 block of West Pico Boulevard during a drug deal and street robbery.
112 | Detectives were unable to find the family of Adolfo Morales, also known as Andres J. Garnica, until they received a lead through a wire service reporter's inquiry.
113 | ",
114 | Meeker,Gibson,Meeker Gibson,Unsolved,35, Male, Black, 1992-05-01, Holt & Loranne avenues,Pomona,Homicide,-117.7306469,34.0628458,"Meeker Gibson, a 35-year-old black man, was shot and killed Friday, May 1, 1992, in an apparent drive-by shooting at a telephone stand at a gas station at Holt and Loranne avenues in Pomona.","Meeker Gibson, a 35-year-old black man, was shot and killed Friday, May 1, 1992, in an apparent drive-by shooting at a telephone stand at a gas station at Holt and Loranne avenues in Pomona.",
115 | Matthew D.,Haines,Matthew D. Haines,Solved,32, Male, White, 1992-04-30, Lemon Avenue & Pacific Coast Highway,Long Beach,Homicide,-118.1785114,33.7898575,"Matthew Haines, a 32-year-old white man, was beaten and shot in the head, Thursday, April 30, 1992, in Long Beach.
116 | Haines and his nephew, Scott Coleman, 26, were pulled from Haines' motorcycle at the corner of Lemon Avenue and Pacific Coast Highway. Haines was beaten, kicked and fatally shot in the head. Coleman was shot but survived.
117 | ","Matthew Haines, a 32-year-old white man, was beaten and shot in the head, Thursday, April 30, 1992, in Long Beach.
118 | Haines and his nephew, Scott Coleman, 26, were pulled from Haines' motorcycle at the corner of Lemon Avenue and Pacific Coast Highway. Haines was beaten, kicked and fatally shot in the head. Coleman was shot but survived.
119 | In February 1993, a Superior Court jury acquitted Larry Williams, 24, Fabian Nixon, 19, and Brent Lamar Jones, 18, of murder. Instead they were found guilty of assault with a deadly weapon and conspiring to assault, loot and rob. The jury said the three weren't guilty of murder because ""there wasn't evidence proving that the three defendants actually did shoot the victim,"" the forewoman said at the time.
120 | Williams and Nixon were sentenced to nearly six years in prison and ordered to pay restitution. Jones, who was a minor at the time, was sentenced to five years and eight months in the California Youth Authority and ordered to pay $5,000 to a crime victims' restitution fund.
121 | ",
122 | Jimmie ,Harris,Jimmie Harris,,38,Male,Black,4/29/1992,Avalon Boulevard & Slauson Avenue,South Park,Death,-118.2651995,33.989245,"Jimmie Harris, a 38-year-old black man, died Monday, May 4, 1992, at a local hospital. Harris was involved in a car accident April 29 at the intersection of Avalon Boulevard and Slauson Avenue in South Park. ","Jimmie Harris, a 38-year-old black man, died Monday, May 4, 1992, at a local hospital. Harris was involved in a car accident April 29 at the intersection of Avalon Boulevard and Slauson Avenue in South Park. ",
123 | DeAndre,Harrison,DeAndre Harrison,,17, Male, Black, 1992-04-30, Central Avenue & 112th Street,Green Meadows,Officer involved shooting,-118.2542949,33.9294721,"DeAndre Harrison, a 17-year-old-black man, was fatally shot Thursday, April 30, 1992, near the intersection of Central Avenue and 112th Street in Green Meadows. He was taken to Martin Luther King Jr./Drew Medical Center, where he died.
124 | ","DeAndre Harrison, a 17-year-old-black man, was fatally shot Thursday, April 30, 1992, near the intersection of Central Avenue and 112th Street in Green Meadows. He was taken to Martin Luther King Jr./Drew Medical Center, where he died.
125 | Less than four hours after truck driver Reginald O. Denny and others were attacked at Florence and Normandie, four LAPD officers in a patrol car said they came under intense fire from looters outside a Korean American-owned store in Green Meadows at Central Avenue and 112th Street.
126 | The officers returned fire and then sped off to await reinforcements. One of seven rounds they fired had hit a heavyset, shirtless gunman.
127 | When they returned, the victim and his weapon had vanished. LAPD officials later learned that 17-year-old Harrison had died of a gunshot wound at the hospital, and ballistics tests showed that he had been struck by a 9-millimeter bullet fired by an LAPD officer.
128 | Harrison was angry over the verdicts in the King beating case, relatives said, and had helped loot clothing stores earlier in the night.
129 | But whether he was the shirtless suspect who shot at police is another question.
130 | About 10:30 p.m., there was a soft knock on the door of an apartment Harrison's girlfriend shared with her mother, Myra Collins. It was Harrison, Collins said later, and he was wearing a blood-drenched T-shirt with a small bullet hole in the chest.
131 | ""It was just like when you watch these westerns and they stagger in the door,"" she said.
132 | ""I don't know what DeAndre was doing,"" Collins said. ""I don't know if he was an angel or a devil. But he did have on a white T-shirt.""
133 | ""He was just a kid that got caught up in a vicious cycle,"" said Verbum Dei High School Principal Robert Mendoza, who had known Harrison for years. ""It's very difficult to live around here.""",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
134 | Paul D.,Horace,Paul D. Horace,Solved,38, Male, Black, 1992-05-01, 1439 E. Walnut,Central-Alameda,Homicide,-118.2474139,34.0217355,"Paul D. Horace, a 38-year-old black man, was shot and killed Friday, May 1, 1992, in the 1400 block of East Walnut Avenue in Central-Alameda. Horace, of Benicia, was fatally shot while trying to buy cocaine on the edge of Los Angeles' garment district, police said. ","Paul D. Horace, a 38-year-old black man, was shot and killed Friday, May 1, 1992, in the 1400 block of East Walnut Avenue in Central-Alameda. Horace, of Benicia, was fatally shot while trying to buy cocaine on the edge of Los Angeles' garment district, police said. ",
135 | Betty,Jackson,Betty Jackson,,56, Female, Black, 1992-05-01, Main & 51st streets,South Park,Death,-118.2739305,33.9965216,"Betty Jackson, a 56-year-old black woman, died Friday, May 1, 1992, in South Park while rushing to deliver some barbecued chicken to a friend before the citywide evening curfew began.
136 | The small car that Jackson and her sister were in was struck by a van at Main and 51st streets. Traffic lights were out throughout the area.
137 | ""Betty was very generous,"" said Ingrid Chamberlin, a relative. ""Betty was like the one person you would want to win the lottery. If she's rich, everybody's rich. That's the kind of person she is.""
138 | ","Betty Jackson, a 56-year-old black woman, died Friday, May 1, 1992, in South Park while rushing to deliver some barbecued chicken to a friend before the citywide evening curfew began.
139 | The small car that Jackson and her sister were in was struck by a van at Main and 51st streets. Traffic lights were out throughout the area.
140 | ""Betty was very generous,"" said Ingrid Chamberlin, a relative. ""Betty was like the one person you would want to win the lottery. If she's rich, everybody's rich. That's the kind of person she is.""
141 | ",
142 | Dennis Ray,Jackson,Dennis Ray Jackson,,38, Male, Black, 1992-04-30, 11322 Alvaro St.,Watts,Officer involved shooting,-118.2537567,33.93229185,"Dennis Ray Jackson, a 38-year-old black man, was shot and killed Thursday, April 30, 1992, in Watts. Jackson and Anthony Taylor, 31, both longtime residents of Watts, had been drinking beer in a parking lot adjacent to the Nickerson Gardens housing project when they were caught in a firefight between police and an alleged sniper.","Dennis Ray Jackson, a 38-year-old black man, was shot and killed Thursday, April 30, 1992, in Watts. Jackson and Anthony Taylor, 31, both longtime residents of Watts, had been drinking beer in a parking lot adjacent to the Nickerson Gardens housing project when they were caught in a firefight between police and an alleged sniper.",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
143 | Tranh,Lam,Tranh Lam,Unsolved,25, Male, Asian, 1992-04-30, Willowbrook Avenue & Alondra Boulevard,Compton,Homicide,-118.2238673,33.8885943,"Thanh Lam, a 25-year-old Asian man, was shot and killed Thursday, April 30, 1992, in Compton.
144 | Lam was leaving his family's market in Compton, which had been looted and burned the night before. The traffic signal at Willowbrook Avenue and Alondra Boulevard had turned yellow, and Lam slowed to a stop.
145 | A car bumped him from the rear and pulled up in the next lane. At least two gunmen leaned out with handguns and began firing. One bullet shattered the truck's window; a volley of shots ripped into the cab.
146 | Four bullets hit Lam, and within minutes he was dead.
147 | ","Thanh Lam, a 25-year-old Asian man, was shot and killed Thursday, April 30, 1992, in Compton.
148 | Lam was leaving his family's market in Compton, which had been looted and burned the night before. The traffic signal at Willowbrook Avenue and Alondra Boulevard had turned yellow, and Lam slowed to a stop.
149 | A car bumped him from the rear and pulled up in the next lane. At least two gunmen leaned out with handguns and began firing. One bullet shattered the truck's window; a volley of shots ripped into the cab.
150 | Four bullets hit Lam, and within minutes he was dead.
151 | ",http://articles.latimes.com/print/1992-08-17/news/mn-5142_1_thanh-lam
152 | Edward Song,Lee,Edward Song Lee,Solved,18, Male, Asian, 1992-04-30, Hobart Boulevard & 3rd Street,Koreatown,Homicide,-118.3054392,34.0689851,"Edward Song Lee, an 18-year-old Asian man, was shot and killed Thursday, April 30, 1992, in Koreatown. Lee, a Korean American, was attempting to protect shops near 3rd Street and Hobart Boulevard when he was apparently shot by fellow Korean Americans who mistook him for a looter. ","Edward Song Lee, an 18-year-old Asian man, was shot and killed Thursday, April 30, 1992, in Koreatown. Lee, a Korean American, was attempting to protect shops near 3rd Street and Hobart Boulevard when he was apparently shot by fellow Korean Americans who mistook him for a looter. ",
153 | Frank D.,Lopez,Frank D. Lopez,Unsolved,36, Male, Latino, 1992-04-30, 16th Street & Central Avenue,Downtown,Homicide,-118.2487649,34.0264271,"Frank D. Lopez, a 36-year-old Latino, died Thursday, April 30, 1992, after he was struck by a truck driven by a hit-and-run motorist at 16th Street and Central Avenue south of downtown Los Angeles.","Frank D. Lopez, a 36-year-old Latino, died Thursday, April 30, 1992, after he was struck by a truck driven by a hit-and-run motorist at 16th Street and Central Avenue south of downtown Los Angeles.",
154 | Darnell R.,Mallory,Darnell R. Mallory,,18,Male,Black,4/30/1992,Santa Monica Boulevard & Seward Street,Hollywood,Death,-118.3341384,34.09097156,"Darnell R. Mallory, an 18-year-old black man, Jerel L. Channell, a 26-year-old black man, and Juanita Pettaway, a 37-year-old black woman, were killed in an auto accident Thursday, April 30, 1992, in Hollywood.
155 | The trio fled after Beverly Hills police officers noticed a defective taillight on their car and tried to stop them. After a high-speed chase down side streets, their car jumped a curb and crashed into a wall at Santa Monica Boulevard and Seward Street.
156 | An investigation showed that the three had robbed a man of his wallet in West Los Angeles. ""We have no reason to believe this was anything more than a common street robbery,"" said police.
157 | ""This is considered a riot case because of the riot-related robbery,"" the coroner's report says.
158 | ","Darnell R. Mallory, an 18-year-old black man, Jerel L. Channell, a 26-year-old black man, and Juanita Pettaway, a 37-year-old black woman, were killed in an auto accident Thursday, April 30, 1992, in Hollywood.
159 | The trio fled after Beverly Hills police officers noticed a defective taillight on their car and tried to stop them. After a high-speed chase down side streets, their car jumped a curb and crashed into a wall at Santa Monica Boulevard and Seward Street.
160 | An investigation showed that the three had robbed a man of his wallet in West Los Angeles. ""We have no reason to believe this was anything more than a common street robbery,"" said police.
161 | ""This is considered a riot case because of the riot-related robbery,"" the coroner's report says.
162 | ",
163 | Lucie R.,Maronian,Lucie R. Maronian,Solved,51, Female, White, 1992-05-01, 1800 block of East New York Drive,Altadena,Homicide,-118.1134357,34.1785051,"Lucie Maronian, a 51-year-old white woman, was stabbed to death Friday, May 1, 1992, in the 1800 block of East New York Drive in Altadena.
164 | Maronian was found stabbed in her home. According to sheriff's investigators, she was killed after confronting a group of teenagers who had been chasing her 14-year-old son and his friend from a nearby intersection.
165 | ","Lucie Maronian, a 51-year-old white woman, was stabbed to death Friday, May 1, 1992, in the 1800 block of East New York Drive in Altadena.
166 | Maronian was found stabbed in her home. According to sheriff's investigators, she was killed after confronting a group of teenagers who had been chasing her 14-year-old son and his friend from a nearby intersection.
167 | In October 1994, two Altadena teenagers, previously accused of the murder of Maronian, were given five years' probation on related charges. O'Dell Whitley Jr., 19, and Leonard Hampton, 18, were sentenced in Pasadena Superior Court for commercial burglary of an Arcadia sporting goods store and attempted robbery of a pedestrian.
168 | The two originally were charged with a series of crimes that included the stabbing of Maronian.
169 | In April 1993, Whitley and Hampton were found guilty of the lesser crimes. But a mistrial was declared on the murder charge when only four of the 12 jurors voted for conviction. The district attorney decided not to retry the two for murder.
170 | ",http://articles.latimes.com/print/1994-10-06/local/me-47089_1_lesser-crimes
171 | Howard Eugene,Martin,Howard Eugene Martin,,22, Male, Black, 1992-05-03, near North Los Robles Avenue & Claremont Street,Pasadena,Officer involved shooting,-118.141613,34.1668637,"Howard Eugene Martin, a 22-year-old black man, was shot and killed Sunday, May 3, 1992, near the intersection of North Los Robles Avenue and Claremont Street in Pasadena.
172 | He was known as ""Nine Lives.""
173 | Twice in the last five years, Howard E. Martin had been a passenger in cars where the driver was killed.
174 | Once, it was a late-night automobile crash. The other time a friend was shot in the head by masked gunmen. ""The boy just fell into Howard's lap,"" recalls his sister, Wanda.
175 | Martin's luck finally ran out three days after the verdicts in the King beating case. The father of three, who grew up only a couple of blocks from King, was killed by a stray bullet.","Howard Eugene Martin, a 22-year-old black man, was shot and killed Sunday, May 3, 1992, near the intersection of North Los Robles Avenue and Claremont Street in Pasadena.
176 | He was known as ""Nine Lives.""
177 | Twice in the last five years, Martin had been a passenger in cars where the driver was killed.
178 | Once, it was a late-night automobile crash. The other time a friend was shot in the head by masked gunmen. ""The boy just fell into Howard's lap,"" recalls his sister, Wanda.
179 | Martin's luck finally ran out three days after the verdicts in the King beating case. The father of three, who grew up only a couple of blocks from King, was killed by a stray bullet.
180 | The incident began, police said, when two officers tried to disperse more than 150 party-goers at a Pasadena apartment complex but were greeted with rocks and bottles -- and gunshots.
181 | Nearly 25 more officers arrived quickly, and 10 of them fired a total of 70 rounds at several assailants.
182 | Martin, relatives said, was visiting friends at a nearby apartment when he stepped onto a balcony to look at what was going on. He was struck in the head by a police bullet that apparently ricocheted off the street, police said.
183 | Martin's sister and other relatives said police should have shown more control over their gunfire. ""They probably felt they were under attack,"" she said. ""But that doesn't justify firing 70 rounds.""",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
184 | Ira F.,McCurry,Ira F. McCurry,Unsolved,45, Male, White, 1992-04-30, Avalon Boulevard & 102nd Street,Green Meadows,Homicide,-118.265163,33.9437558,"Ira F. McCurry, a 45-year-old white man, was shot and killed Thursday, April 30, 1992, near the intersection of 102nd Street and Avalon Boulevard in Green Meadows.
185 | McCurry was shot in the head as he tried to stop looters from starting a fire in a liquor store that could have spread to the adjacent residence he shared with a friend.
186 | An Army veteran, McCurry had fallen on hard times before meeting county golf course maintenance worker John Huff two years ago. McCurry, who was homeless, was employed at the same golf course as part of a general relief workfare program when Huff took him into his Watts-area home.
187 | ""Over time, he became a part of my family,"" Huff, 50, said.
188 | ","Ira F. McCurry, a 45-year-old white man, was shot and killed Thursday, April 30, 1992, near the intersection of 102nd Street and Avalon Boulevard in Green Meadows.
189 | McCurry was shot in the head as he tried to stop looters from starting a fire in a liquor store that could have spread to the adjacent residence he shared with a friend.
190 | An Army veteran, McCurry had fallen on hard times before meeting county golf course maintenance worker John Huff two years ago. McCurry, who was homeless, was employed at the same golf course as part of a general relief workfare program when Huff took him into his Watts-area home.
191 | ""Over time, he became a part of my family,"" Huff, 50, said.
192 | ",http://articles.latimes.com/print/1992-06-21/news/mn-1582_1_south-los-angeles
193 | Alfred V.,Miller,Alfred V. Miller,Solved,32,Male,Black,5/1/1992,Florence Avenue & Cimarron Street,Chesterfield Square,Homicide,-118.3157372,33.9745911,"Alfred V. Miller, a 32-year-old black man, was fatally shot Friday, May 1, 1992, in Chesterfield Square. Miller was wounded as he rode in a car at the intersection of Florence Avenue and Cimarron Street. He was taken to Daniel Freeman Memorial Hospital, where he was pronounced dead.
194 | The drive-by shooting of Miller, who was wearing a body cast from a previous shooting, may have been connected to a past feud, authorities said.
195 | ""There was no exchange of words, no confrontation -- just the shots fired,"" said LAPD Det. Rosemary Sanchez.
196 | A suspect was arrested in the Miller slaying, but the district attorney's office decided that the witness' identification was too shaky.
197 | ","Alfred V. Miller, a 32-year-old black man, was fatally shot Friday, May 1, 1992, in Chesterfield Square. Miller was wounded as he rode in a car at the intersection of Florence Avenue and Cimarron Street. He was taken to Daniel Freeman Memorial Hospital, where he was pronounced dead.
198 | The drive-by shooting of Miller, who was wearing a body cast from a previous shooting, may have been connected to a past feud, authorities said.
199 | ""There was no exchange of words, no confrontation -- just the shots fired,"" said LAPD Det. Rosemary Sanchez.
200 | A suspect was arrested in the Miller slaying, but the district attorney's office decided that the witness' identification was too shaky.
201 | ",http://articles.latimes.com/print/1992-05-16/local/me-1888_1_shooting-death
202 | Arturo C.,Miranda,Arturo C. Miranda,Unsolved,23, Male, Latino, 1992-04-29, 120th Street & Central Avenue,Green Meadows,Homicide,-118.2543429,33.9237304,"Arturo C. Miranda, a 23-year-old Latino, was fatally shot Wednesday, April 29, 1992, near the intersection of 120th Street and Central Avenue in Green Meadows.
203 | Miranda was riding home from a soccer game with friends when a bullet tore through the vehicle, striking him in the head. His friends rushed him to Memorial Hospital in Gardena, where he was pronounced dead.
204 | Miranda had arrived in Los Angeles from Mexico less than a year before and had worked for a textile company. His co-workers raised enough money so his body could be returned to his hometown of Guerrero, Mexico.
205 | ","Arturo C. Miranda, a 23-year-old Latino, was fatally shot Wednesday, April 29, 1992, near the intersection of 120th Street and Central Avenue in Green Meadows.
206 | Miranda was riding home from a soccer game with friends when a bullet tore through the vehicle, striking him in the head. His friends rushed him to Memorial Hospital in Gardena, where he was pronounced dead.
207 | Miranda had arrived in Los Angeles from Mexico less than a year before and had worked for a textile company. His co-workers raised enough money so his body could be returned to his hometown of Guerrero, Mexico.
208 | ",http://articles.latimes.com/print/1992-06-21/news/mn-1582_1_south-los-angeles
209 | Suzanne R.,Morgan,Suzanne R. Morgan,,24,Female,Black,5/1/1992,2137 E. 115th St.,Watts,Not riot-related,-118.2344108,33.9304917,"Suzanne R. Morgan, a 24-year-old black woman, was shot and killed Friday, May 1, 1992, in the 2100 block of East 115th Street in Watts. Morgan was allegedly shot at her apartment by her boyfriend. Police say he obtained the gun because of the rioting.","Suzanne R. Morgan, a 24-year-old black woman, was shot and killed Friday, May 1, 1992, in the 2100 block of East 115th Street in Watts. Morgan was allegedly shot at her apartment by her boyfriend. Police say he obtained the gun because of the rioting.",
210 | Nissar,Mustafa,Nissar Mustafa,Unsolved,20, Male, White, 1992-08-12, 1601 S. Western Ave. ,Harvard Heights,Homicide,-118.3090341,34.0435539,"Nissar Mustafa (John Doe #172). The charred and decomposed body of John Doe #172 was discovered Aug. 12, 1992, in Harvard Heights in the 1600 block of South Western Avenue. The body was found by a demolition crew clearing the rubble inside a J.J. Newberry store that was burned by looters on the first night of riots.
211 | The body was later identified as Nissar Mustafa, a 20-year-old white man.","Nissar Mustafa (John Doe #172). The charred and decomposed body of John Doe #172 was discovered Aug. 12, 1992, in Harvard Heights in the 1600 block of South Western Avenue. The body was found by a demolition crew clearing the rubble inside a J.J. Newberry store that was burned by looters on the first night of riots.
212 | The body was later identified as Nissar Mustafa, a 20-year-old white man.
213 | ",
214 | Ernest,Neal Jr.,Ernest Neal Jr.,Unsolved,27, Male, Black, 1992-04-30, Western Avenue & 92nd Street,Gramercy Park,Homicide,-118.309006,33.952709,"Ernest Neal Jr., a 27-year-old black man, was shot to death Thursday, April 30, 1992, in Gramercy Park. Neal and Elbert Wilkins, 33, were killed as they stood outside a liquor store at 92nd Street and Western Avenue.","Ernest Neal Jr., a 27-year-old black man, was shot to death Thursday, April 30, 1992, in Gramercy Park. Neal and Elbert Wilkins, 33, were killed as they stood outside a liquor store at 92nd Street and Western Avenue.",
215 | Anthony,Netherly,Anthony Netherly,Unsolved,21, Male, Black, 1992-04-30, San Pedro & 78th streets,Florence,Homicide,-118.2695156,33.9687806,"Anthony Netherly, a 21-year-old black man, was shot to death Thursday, April 30, 1992, in Florence. Netherly was struck in the head by a random bullet while riding in a car at the intersection of 78th and San Pedro streets.","Anthony Netherly, a 21-year-old black man, was shot to death Thursday, April 30, 1992, in Florence. Netherly was struck in the head by a random bullet while riding in a car at the intersection of 78th and San Pedro streets.",
216 | Charles W.,Orebo,Charles W. Orebo,,21, Male, Black, 1992-05-01, Florence Avenue & Flower Street,Florence,Officer involved shooting,-118.2812901,33.9746575,"Charles Orebo, a 21-year-old black man, was shot and killed Friday, May 1, 1992, near the intersection of Florence Avenue and Flower Street in Florence.
217 | Charles ""Sticks"" Orebo and two friends, Andre Webb and Lavelle ""Frog"" Williams were driving toward a South Los Angeles house where Webb planned to spend the night.
218 | Near Florence Avenue and the 110 Freeway, Orebo tried to make a lane change, nearly cutting off a car behind him. The other driver honked and pulled alongside at a stoplight.
219 | Williams drew a handgun, loaded it and pointed it past Orebo toward the other driver, an LAPD officer who was out of uniform and en route to work.
220 | ""The guy looked at us,"" Webb said, ""and he jumped like he was in shock. Then he pulled up his gun. . . . Then he shot like three times and hit Sticks.""
221 | Orebo, mortally wounded, punched the accelerator. The car lurched into a wall and caught fire.
222 | ","Charles Orebo, a 21-year-old black man, was shot and killed Friday, May 1, 1992, near the intersection of Florence Avenue and Flower Street in Florence.
223 | Charles ""Sticks"" Orebo and two friends, Andre Webb and Lavelle ""Frog"" Williams were driving toward a South Los Angeles house where Webb planned to spend the night.
224 | Near Florence Avenue and the 110 Freeway, Orebo tried to make a lane change, nearly cutting off a car behind him. The other driver honked and pulled alongside at a stoplight.
225 | Williams drew a handgun, loaded it and pointed it past Orebo toward the other driver, an LAPD officer who was out of uniform and en route to work.
226 | ""The guy looked at us,"" Webb said, ""and he jumped like he was in shock. Then he pulled up his gun. . . . Then he shot like three times and hit Sticks.""
227 | Orebo, mortally wounded, punched the accelerator. The car lurched into a wall and caught fire.
228 | Orebo, a dropout and the father of a 4-year-old son, had planned to get married the next month and become an auto mechanic, said his mother, Georgia Alfred.
229 | He had been jailed a couple of times for traffic tickets and other small offenses, she said. ""But nothing violent. No guns or anything like that.""
230 | Alfred said her son and Williams watched the verdicts in the King beating case together and were angry, ""but he wasn't going out beating anyone or carrying a gun.""
231 | ""From what I gathered, my son didn't know [Williams] had the gun until he pulled it up,"" she said. ""I'm angry, but I'm angry with the young man.""
232 | ",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
233 | Juanita ,Pettaway,Juanita Pettaway,,37,Female,Black,4/30/1992,Santa Monica Boulevard & Seward Street,Hollywood,Death,-118.3331771,34.090696,"Darnell R. Mallory, an 18-year-old black man, Jerel L. Channell, a 26-year-old black man, and Juanita Pettaway, a 37-year-old black woman, were killed in an auto accident Thursday, April 30, 1992, in Hollywood.
234 | The trio fled after Beverly Hills police officers noticed a defective taillight on their car and tried to stop them. After a high-speed chase down side streets, their car jumped a curb and crashed into a wall at Santa Monica Boulevard and Seward Street.
235 | An investigation showed that the three had robbed a man of his wallet in West Los Angeles. ""We have no reason to believe this was anything more than a common street robbery,"" said police.
236 | ""This is considered a riot case because of the riot-related robbery,"" the coroner's report says.
237 | ","Darnell R. Mallory, an 18-year-old black man, Jerel L. Channell, a 26-year-old black man, and Juanita Pettaway, a 37-year-old black woman, were killed in an auto accident Thursday, April 30, 1992, in Hollywood.
238 | The trio fled after Beverly Hills police officers noticed a defective taillight on their car and tried to stop them. After a high-speed chase down side streets, their car jumped a curb and crashed into a wall at Santa Monica Boulevard and Seward Street.
239 | An investigation showed that the three had robbed a man of his wallet in West Los Angeles. ""We have no reason to believe this was anything more than a common street robbery,"" said police.
240 | ""This is considered a riot case because of the riot-related robbery,"" the coroner's report says.
241 | ",
242 | Juan A.,Pineda,Juan A. Pineda,Solved,20, Male, Latino, 1992-04-30, 4028 Santa Monica Blvd.,Silver Lake,Homicide,-118.281326,34.092221,"Juan A. Pineda, a 20-year-old Latino, was fatally shot Thursday, April 30, 1992, at 4028 Santa Monica Blvd. in Silver Lake. He was taken to a local hospital, were he died.
243 | Pineda, a cook at a Mexican restaurant on Wilshire Boulevard, was struck by several bullets during a firefight outside Auto Color Plus Inc., a car paint and supply shop near the corner of Santa Monica and Sunset boulevards.
244 | ","Juan A. Pineda, a 20-year-old Latino, was fatally shot Thursday, April 30, 1992, at 4028 Santa Monica Blvd. in Silver Lake. He was taken to a local hospital, were he died.
245 | Pineda, a cook at a Mexican restaurant on Wilshire Boulevard, was struck by several bullets during a firefight outside Auto Color Plus Inc., a car paint and supply shop near the corner of Santa Monica and Sunset boulevards. ",
246 | Hugo G.,Ramirez,Hugo G. Ramirez,,23, Male, Latino, 1992-05-03, 12732 Bess St.,Baldwin Park,Not riot-related,-117.997106,34.070238,"Hugo Ramirez, a 23-year-old Latino, was shot and killed Sunday, May 3, 1992, in Baldwin Park. Ramirez was found face-down in the street, with a gunshot wound to the head, in the 12700 block of Bess Street.","Hugo Ramirez, a 23-year-old Latino, was shot and killed Sunday, May 3, 1992, in Baldwin Park. Ramirez was found face-down in the street, with a gunshot wound to the head, in the 12700 block of Bess Street.",
247 | Aaron,Ratinoff,Aaron Ratinoff,Solved,68, Male, White, 1992-05-01, 11690 Gateway Blvd.,Sawtelle,Homicide,-118.4431,34.0286551,"Aaron Ratinoff, a 68-year-old white man, died Friday, May 1, 1992, in the 11600 block of Gateway Boulevard in Sawtelle. Ratinoff was strangled by a supermarket produce manager in a dispute over corn husks.
248 | Ratinoff would never have ended up at the Bob's Market on Gateway Boulevard in West Los Angeles if the store where he normally shopped had remained open during the riots. The produce manager apparently got angry when Ratinoff dropped some corn husks on the floor while shopping for vegetables, and the pair tussled.
249 | Coroner's spokesman Bob Dambacher said the criterion his office has used for riot-related deaths was simple: ""Would this person have died at that particular time and that particular place if the riots had not occurred?""
250 | ","Aaron Ratinoff, a 68-year-old white man, died Friday, May 1, 1992, in the 11600 block of Gateway Boulevard in Sawtelle. Ratinoff was strangled by a supermarket produce manager in a dispute over corn husks.
251 | Ratinoff would never have ended up at the Bob's Market on Gateway Boulevard in West Los Angeles if the store where he normally shopped had remained open during the riots. The produce manager apparently got angry when Ratinoff dropped some corn husks on the floor while shopping for vegetables, and the pair tussled.
252 | Coroner's spokesman Bob Dambacher said the criterion his office has used for riot-related deaths was simple: ""Would this person have died at that particular time and that particular place if the riots had not occurred?""
253 | ",
254 | Victor R.,Rivas,Victor R. Rivas,,26, Male, Latino, 1992-05-03, Pico Boulevard & Vermont Avenue,Pico-Union,Officer involved shooting,-118.291583,34.0472563,"Victor R. Rivas, a 26-year-old Latino, was shot and killed Sunday, May 3, 1992, in Pico-Union. Rivas was shot after he allegedly refused to stop his car at a barricade and tried several times to run a National Guardsman down at the intersection of Pico Boulevard and Vermont Avenue.","Victor R. Rivas, a 26-year-old Latino, was shot and killed Sunday, May 3, 1992, in Pico-Union. Rivas was shot after he allegedly refused to stop his car at a barricade and tried several times to run a National Guardsman down at the intersection of Pico Boulevard and Vermont Avenue.",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
255 | William,Ross,William Ross,Unsolved,33, Male, White, 1992-05-01, 2882 W. 9th St.,Koreatown,Homicide,-118.291274,34.05569,"William Ross, a 33-year-old white man, died Friday, May 1, 1992, in Koreatown. Ross' body was found Saturday, May 2, inside a market that had been firebombed in the 2800 block of West 9th Street and identified 10 days later through dental records.","William Ross, a 33-year-old white man, died Friday, May 1, 1992, in Koreatown. Ross' body was found Saturday, May 2, inside a market that had been firebombed in the 2800 block of West 9th Street and identified 10 days later through dental records.",http://articles.latimes.com/print/1992-09-10/news/mn-326_1_unidentified-bodies
256 | Juan V.,Salgado,Juan V. Salgado,Unsolved,20,Male,Latino,5/20/1992,3100 block of South Main Street,Historic South-Central,Homicide,-118.2713789,34.02062153,"The body of Juan V. Salgado, a 20-year-old Latino, was found May 20, 1992, inside a burned clothing store in the 3100 block of South Main Street called Collective Merchandise Inc., where he was last seen.","The body of Juan V. Salgado, a 20-year-old Latino, was found May 20, 1992, inside a burned clothing store in the 3100 block of South Main Street called Collective Merchandise Inc., where he was last seen.",
257 | Imad,Sharaf,Imad Sharaf,,31, Male, Black, 1992-05-03, San Diego Freeway & San Fernando Mission Boulevard,Mission Hills,Not riot-related,-118.4717452,34.27185555,"Imad Sharaf's body was found the morning of Sunday, May 3, 1992, when firefighters answered a report of a brush fire near the on-ramp to the 405 Freeway at San Fernando Mission Boulevard in Mission Hills.
258 | At first, Sharaf, a Granada Hills resident who emigrated from Jordan three years ago, was listed as a riot victim. Detectives now believe that he was drugged before he was set ablaze and that the fire may have been an attempt to make the slaying appear riot-related.
259 | Police said that Sharaf, who was a photo lab technician, had been doused with a flammable substance and set afire.
260 | ","Imad Sharaf's body was found the morning of Sunday, May 3, 1992, when firefighters answered a report of a brush fire near the on-ramp to the 405 Freeway at San Fernando Mission Boulevard in Mission Hills.
261 | At first, Sharaf, a Granada Hills resident who emigrated from Jordan three years ago, was listed as a riot victim. Detectives now believe that he was drugged before he was set ablaze and that the fire may have been an attempt to make the slaying appear riot-related.
262 | Police said that Sharaf, who was a photo lab technician, had been doused with a flammable substance and set afire.
263 | ",http://articles.latimes.com/print/1993-04-24/local/me-26740_1_slaying-victims
264 | Jose,Solorzano,Jose Solorzano,Solved,25, Male, Latino, 1992-05-01, Vermont Avenue & Santa Monica Boulevard,East Hollywood,Homicide,-118.291755,34.0908675,"Jose Solorzano, a 25-year-old Latino, was shot and killed Friday, May 1, 1992, in East Hollywood. Solorzano was shot by a security guard while looting at a store at Vermont Avenue and Santa Monica Boulevard.","Jose Solorzano, a 25-year-old Latino, was shot and killed Friday, May 1, 1992, in East Hollywood. Solorzano was shot by a security guard while looting at a store at Vermont Avenue and Santa Monica Boulevard.",
265 | George A.,Sosa,George A. Sosa,Unsolved,20, Male, Latino, 1992-04-30,2600 block of Florence Avenue,Huntington Park,Homicide,,,"George A. Sosa, a 20-year-old Latino, was fatally shot Thursday, April 30, 1992, in the 2600 block of Florence Avenue in Huntington Park.
266 | Sosa was visiting his girlfriend when a gang member who had been drinking asked him what gang he was in and then opened fire, authorities said. Sosa was dead on arrival at County-USC Medical Center.
267 | ","George A. Sosa, a 20-year-old Latino, was fatally shot Thursday, April 30, 1992, in the 2600 block of Florence Avenue in Huntington Park.
268 | Sosa was visiting his girlfriend when a gang member who had been drinking asked him what gang he was in and then opened fire, authorities said. Sosa was dead on arrival at County-USC Medical Center.
269 | ",
270 | Anthony J.,Taylor,Anthony J. Taylor,,31, Male, Black, 1992-04-30, 11322 Alvaro St.,Watts,Officer involved shooting,-118.2531966,33.9314634,"Anthony Taylor, a 31-year-old black man, was shot and killed Thursday, April 30, 1992, in Watts. Taylor and Dennis Ray Jackson, 38, both longtime residents of Watts, had been drinking beer in a parking lot adjacent to the Nickerson Gardens housing project when they were caught in a firefight between police and an alleged sniper.","Anthony Taylor, a 31-year-old black man, was shot and killed Thursday, April 30, 1992, in Watts. Taylor and Dennis Ray Jackson, 38, both longtime residents of Watts, had been drinking beer in a parking lot adjacent to the Nickerson Gardens housing project when they were caught in a firefight between police and an alleged sniper.",http://articles.latimes.com/print/1992-05-24/news/mn-378_1_police-officer
271 | Dwight,Taylor,Dwight Taylor,Unsolved,42, Male, Black, 1992-04-29, 4365 S. Vermont Ave.,Vermont Square,Homicide,-118.292169,34.004453,"Dwight Taylor, a 42-year-old black man, was fatally shot Wednesday, April 29, 1992, in the 4300 block of South Vermont Avenue in Vermont Square.
272 | Taylor was taken to a local hospital, where he died.
273 | Taylor, a former Cal State Long Beach basketball player, still loved to show off his ball handling to youngsters on the courts around South Los Angeles.
274 | In recent years, Taylor worked cutting fish at a neighborhood market.
275 | ""Fishman,"" as friends called him, was on his way to visit his estranged wife and their children on the first night of the riots. When he stopped at a supermarket at Vermont and Vernon avenues to pick up some milk, he was shot in the parking lot along with two teenagers.
276 | ","Dwight Taylor, a 42-year-old black man, was fatally shot Wednesday, April 29, 1992, in the 4300 block of South Vermont Avenue in Vermont Square.
277 | Taylor was taken to a local hospital, where he died.
278 | Taylor, a former Cal State Long Beach basketball player, still loved to show off his ball handling to youngsters on the courts around South Los Angeles.
279 | In recent years, Taylor worked cutting fish at a neighborhood market.
280 | ""Fishman,"" as friends called him, was on his way to visit his estranged wife and their children on the first night of the riots. When he stopped at a supermarket at Vermont and Vernon avenues to pick up some milk, he was shot in the parking lot along with two teenagers.
281 | ",http://articles.latimes.com/print/1992-06-21/news/mn-1582_1_south-los-angeles
282 | James L.,Taylor,James L. Taylor,Solved,26, Male, Black, 1992-04-30, 5213 Sunset Blvd.,East Hollywood,Homicide,-118.3037557,34.0982485,"James L. Taylor, a 26-year-old black man, was shot and killed Thursday, April 30, 1992, in East Hollywood. Taylor was shot in the back at the scene of a looted video store and cleaners in the 5200 block of Sunset Boulevard.","James L. Taylor, a 26-year-old black man, was shot and killed Thursday, April 30, 1992, in East Hollywood. Taylor was shot in the back at the scene of a looted video store and cleaners in the 5200 block of Sunset Boulevard.",
283 | Wallace,Tope,Wallace Tope,Solved,54, Male, White, 1993-11-24, 5510 W. Sunset Blvd.,Hollywood,Homicide,-118.3098224,34.0980819,"Wallace Tope, a 54-year-old white man, died Nov. 24, 1993. Tope had been in coma since he was assaulted April 30, 1992, in the 5500 block of West Sunset Boulevard in Hollywood.
284 | A street evangelist, Tope went to a shopping mall at the corner of Western Avenue and Sunset Boulevard, where hundreds of people had gathered to watch looters ransack a Sav-On drugstore. There he began to preach, urging the crowd to stop the looting and place their faith in Jesus. As he was preaching, two men began to beat him. When he tried to flee, he fell to the ground, and the men kicked him repeatedly in the head for nearly three minutes, witnesses said.
285 | Tope was rescued by a passing ambulance, but he lapsed into a coma shortly after arriving at the hospital. ","Wallace Tope, a 54-year-old white man, died Nov. 24, 1993. Tope had been in coma since he was assaulted April 30, 1992, in the 5500 block of West Sunset Boulevard in Hollywood.
286 | A street evangelist, Tope went to a shopping mall at the corner of Western Avenue and Sunset Boulevard, where hundreds of people had gathered to watch looters ransack a Sav-On drugstore. There he began to preach, urging the crowd to stop the looting and place their faith in Jesus. As he was preaching, two men began to beat him. When he tried to flee, he fell to the ground, and the men kicked him repeatedly in the head for nearly three minutes, witnesses said.
287 | Tope was rescued by a passing ambulance, but he lapsed into a coma shortly after arriving at the hospital.
288 | Two men charged with murder in the last major case of the Los Angeles riots each pleaded no contest in the fatal beating of Tope and were sentenced to prison May 9, 1994.
289 | Fidel Ortiz, 22, and Leonard Sosa, 24, both former warehouse workers for a Dodger Stadium concessionaire, entered the pleas to reduced charges of voluntary manslaughter on the same day they were to go on trial for the April 30, 1992, attack.
290 | Under a plea agreement, the judge in the case sentenced Ortiz to an 11-year prison term and Sosa to a six-year term.
291 | ","http://articles.latimes.com/print/1992-05-16/local/me-1814_1_looters
292 | http://articles.latimes.com/print/1993-12-02/local/me-63138_1_wallace-tope-jr
293 | http://articles.latimes.com/print/1994-05-10/local/me-55879_1_reduced-charges
294 | "
295 | Edward Anthony,Travens,Edward Anthony Travens,,15, Male, White, 1992-04-29, San Fernando Road & San Fernando Mission Boulevard,San Fernando,Not riot-related,-118.4430027,34.28418731,"Edward A. Travens, a 15-year-old white youth, was fatally shot Wednesday, April 29, 1992, near the intersection of San Fernando Road and Mission Boulevard in San Fernando.
296 | Travens was driving to a video store with his brother, Allen, 21, and a friend, Dan Ortiz. About 9:25 p.m., at the intersection of San Fernando Road and Mission Boulevard, they were approached by a man on foot.
297 | ""All they heard was 'Where you from?' and 'Boom, boom, boom, boom, boom,'"" said Travens' uncle, Richard Ballasteros. Five bullets pierced Travens' wiry body. Ortiz drove him to a hospital while Allen Travens cradled his brother in his arms. Eddie Travens died three hours later.
298 | ","Edward A. Travens, a 15-year-old white youth, was fatally shot Wednesday, April 29, 1992, near the intersection of San Fernando Road and Mission Boulevard in San Fernando.
299 | Travens was driving to a video store with his brother, Allen, 21, and a friend, Dan Ortiz. About 9:25 p.m., at the intersection of San Fernando Road and Mission Boulevard, they were approached by a man on foot.
300 | ""All they heard was 'Where you from?' and 'Boom, boom, boom, boom, boom,'"" said Travens' uncle, Richard Ballasteros. Five bullets pierced Travens' wiry body. Ortiz drove him to a hospital while Allen Travens cradled his brother in his arms. Eddie Travens died three hours later.
301 | ",http://articles.latimes.com/print/1992-05-07/news/mn-2526_1_young-men
302 | Eduardo C.,Vela,Eduardo C. Vela,Unsolved,33, Male, Latino, 1992-04-29, 5100 block of West Slauson Avenue,Ladera Heights,Homicide,-118.3687199,33.9876036,"Eduardo C. Vela, a 33-year-old Latino, was shot and killed Wednesday, April 29, 1992, in the 5100 block of West Slauson Avenue in Ladera Heights.
303 | Vela, a Mexican immigrant who ran a Japanese restaurant in Bakersfield, was visiting Los Angeles on the day the riots broke out. He was killed as he waited behind the steering wheel of his disabled car while a co-worker, Estevan Ortigoza, went to make a telephone call.
304 | ","Eduardo C. Vela, a 33-year-old Latino, was shot and killed Wednesday, April 29, 1992, in the 5100 block of West Slauson Avenue in Ladera Heights.
305 | Vela, a Mexican immigrant who ran a Japanese restaurant in Bakersfield, was visiting Los Angeles on the day the riots broke out. He was killed as he waited behind the steering wheel of his disabled car while a co-worker, Estevan Ortigoza, went to make a telephone call.
306 | ",http://articles.latimes.com/print/1992-06-21/news/mn-1582_1_south-los-angeles
307 | Fredrick,Ward,Fredrick Ward,Unsolved,20, Male, Black, 1992-05-02, 11932 Cometa Ave.,Pacoima,Homicide,-118.412778,34.287098,"Fredrick Ward, a 20-year-old black man, was shot and killed Saturday, May 2, 1992, in the 11900 block of Cometa Avenue in Pacoima.
308 |
309 | ","Fredrick Ward, a 20-year-old black man, was shot and killed Saturday, May 2, 1992, in the 11900 block of Cometa Avenue in Pacoima.
310 |
311 | ",
312 | Louis A.,Watson,Louis A. Watson,Unsolved,18, Male, Black, 1992-04-29, 4365 S. Vermont Ave.,Vermont Square,Homicide,-118.2915566,34.00524354,"Louis A. Watson, an 18-year-old black man, was fatally shot Wednesday, April 29, 1992, in the 4300 block of South Vermont Avenue in Vermont Square.
313 | Struck by a single bullet to the head outside a swap meet, Watson was taken to a local hospital, where he died.
314 | ","Louis A. Watson, an 18-year-old black man, was fatally shot Wednesday, April 29, 1992, in the 4300 block of South Vermont Avenue in Vermont Square.
315 | Struck by a single bullet to the head outside a swap meet, Watson was taken to a local hospital, where he died.
316 | Watson, the oldest of seven boys, lived with his mother, Sherry Ann Johnson, and his stepfather on West 43rd.
317 | Friends said Watson had toyed briefly with a gang, then rejected it. His friend, Drama, said Watson decided ""it wasn't worth it. He didn't want to die from gangbanging."" So Watson went back to school and to playing the drums, playing football and running track.
318 | At Watson's funeral, 600 people, many of them teenagers, filled the church to capacity. The service began quietly, with testimony from friends and relatives. Then the grief and tension seemed to escalate to a point where the church was filled with the sound of weeping and wailing.
319 | ",http://articles.latimes.com/print/1992-05-07/news/mn-2526_1_young-men
320 | Elbert O.,Wilkins,Elbert O. Wilkins,Unsolved,33, Male, Black, 1992-04-30, Western Avenue & 92nd Street,Gramercy Park,Homicide,-118.3100043,33.95276731,"Elbert O. Wilkins, a 33-year-old black man, was shot to death Thursday, April 30, 1992, in Gramercy Park. Wilkins and Ernest Neal Jr., 27, were killed as they stood outside a liquor store at 92nd Street and Western Avenue. ","Elbert O. Wilkins, a 33-year-old black man, was shot to death Thursday, April 30, 1992, in Gramercy Park. Wilkins and Ernest Neal Jr., 27, were killed as they stood outside a liquor store at 92nd Street and Western Avenue. ",
321 | John H.,Willers,John H. Willers,Unsolved,37, Male, White, 1992-04-29, 10621 Sepulveda Blvd.,Mission Hills,Homicide,-118.46777,34.263184,"John H. Willers, a 37-year-old white man, was shot and killed Wednesday, April 29, 1992, in the 10600 block of North Sepulveda Boulevard in Mission Hills.
322 | The tile-setter, who was working at a Mission Hills supermarket with his Salt Lake City-based construction crew, was gunned down outside the motel where he was staying.
323 | The crew members had stayed up that night watching riot coverage on television. Around 10:45 p.m., they heard the sound of cars colliding outside the motel -- the conclusion of a chase in which, according to police, three people in one car pursued two robbery suspects in another. The crash brought many of the motel guests out onto the street.
324 | Willers stayed outside until the injured motorists were taken away by ambulance. According to co-workers, he returned to his room but decided to go back out half an hour later. Shots rang out, and he was found dead in the middle of the street.
325 | ""He was caught up in the moment when the city was erupting,"" said Det. Woodrow Parks of the LAPD's Foothill Division. ""It probably was a riot-related thing.""
326 | ","John H. Willers, a 37-year-old white man, was shot and killed Wednesday, April 29, 1992, in the 10600 block of North Sepulveda Boulevard in Mission Hills.
327 | The tile-setter, who was working at a Mission Hills supermarket with his Salt Lake City-based construction crew, was gunned down outside the motel where he was staying.
328 | The crew members had stayed up that night watching riot coverage on television. Around 10:45 p.m., they heard the sound of cars colliding outside the motel -- the conclusion of a chase in which, according to police, three people in one car pursued two robbery suspects in another. The crash brought many of the motel guests out onto the street.
329 | Willers stayed outside until the injured motorists were taken away by ambulance. According to co-workers, he returned to his room but decided to go back out half an hour later. Shots rang out, and he was found dead in the middle of the street.
330 | ""He was caught up in the moment when the city was erupting,"" said Det. Woodrow Parks of the LAPD's Foothill Division. ""It probably was a riot-related thing.""
331 | ",http://articles.latimes.com/print/1993-04-24/local/me-26740_1_slaying-victims
332 | Willie Bernard,Williams,Willie Bernard Williams,,29,Male,Black,4/29/1992,Gage & Western avenues,Chesterfield Square,Death,-118.3089517,33.9823625,"Willie Bernard Williams, a 29-year-old black man, died Wednesday, April 29, 1992, in Chesterfield Square. Williams was thrown from a truck in an accident at Gage and Western avenues in which traffic signals had failed.","Willie Bernard Williams, a 29-year-old black man, died Wednesday, April 29, 1992, in Chesterfield Square. Williams was thrown from a truck in an accident at Gage and Western avenues in which traffic signals had failed.",
333 |
--------------------------------------------------------------------------------
/notebooks/images/boolean_index.svg:
--------------------------------------------------------------------------------
1 |
2 |
730 |
--------------------------------------------------------------------------------
/notebooks/images/broadcasting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/notebooks/images/broadcasting.png
--------------------------------------------------------------------------------
/notebooks/images/indexing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/notebooks/images/indexing.png
--------------------------------------------------------------------------------
/notebooks/images/invalid-broadcasting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/notebooks/images/invalid-broadcasting.png
--------------------------------------------------------------------------------
/notebooks/images/invalid-broadcasting.svg:
--------------------------------------------------------------------------------
1 |
2 |
388 |
--------------------------------------------------------------------------------
/notebooks/images/numpy-array.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/notebooks/images/numpy-array.png
--------------------------------------------------------------------------------
/notebooks/images/numpy-docs-topics.txt:
--------------------------------------------------------------------------------
1 | **Future sections**:
2 |
3 | - [NumPy universal functions]
4 | https://numpy.org/doc/stable/user/quickstart.html#universal-functions
5 | https://numpy.org/doc/stable/reference/c-api/generalized-ufuncs.html
6 | https://numpy.org/doc/stable/reference/ufuncs.html#available-ufuncs
7 |
8 | - [Array indexing]
9 |
10 | https://numpy.org/doc/stable/user/basics.indexing.html
11 | https://numpy.org/doc/stable/user/basics.indexing.html#basics-indexing
12 | https://numpy.org/doc/stable/reference/arrays.indexing.html
13 |
14 |
15 | - [Array masking]
16 |
17 | https://numpy.org/doc/stable/reference/routines.ma.html
18 |
19 | - [Array copy and views]
20 |
21 | https://numpy.org/doc/stable/user/quickstart.html#universal-functions
22 | https://numpy.org/doc/stable/reference/c-api/generalized-ufuncs.html
23 | https://numpy.org/doc/stable/reference/ufuncs.html#available-ufuncs
24 |
25 |
26 | - [Array logic and evaluation]
27 |
28 | https://numpy.org/doc/stable/reference/routines.logic.html
29 |
30 | - [Basic statistics with NumPy]
31 |
32 | https://numpy.org/doc/stable/reference/routines.statistics.html
33 |
34 | - [Basic linear algebra with NumPy]
35 |
36 | https://numpy.org/doc/stable/reference/routines.linalg.html
37 | https://numpy.org/doc/stable/user/quickstart.html#vector-stacking
38 |
39 | - [NumPY Random sampling]
40 |
41 | https://numpy.org/doc/stable/reference/random/index.html
42 |
43 | - [Array string operations]
44 |
45 | https://numpy.org/doc/stable/reference/routines.char.html
46 |
47 | - [NumPY datetime functions]
48 |
49 | https://numpy.org/doc/stable/reference/routines.datetime.html
50 |
51 | - [Structured arrays]
52 |
53 | https://numpy.org/doc/stable/user/basics.rec.html
54 | - [Array iteration]
55 |
56 | https://numpy.org/doc/stable/user/c-info.beyond-basics.html
57 |
58 | - [NumPy constants and scalars]
59 |
60 | https://numpy.org/doc/stable/reference/constants.html
61 | https://numpy.org/doc/stable/reference/arrays.scalars.html
62 |
63 | - [Input-output (I/O) data processing]
64 |
65 | https://numpy.org/doc/stable/user/basics.io.html
66 | https://numpy.org/doc/stable/reference/routines.io.html
67 |
68 | - [Resources to learn more]
--------------------------------------------------------------------------------
/notebooks/images/survey-python.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/notebooks/images/survey-python.png
--------------------------------------------------------------------------------
/notebooks/images/vectorization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/notebooks/images/vectorization.png
--------------------------------------------------------------------------------
/notebooks/intro-pandas-fundamentals.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Introduction Pandas Fundamentals"
8 | ]
9 | },
10 | {
11 | "cell_type": "code",
12 | "execution_count": null,
13 | "metadata": {},
14 | "outputs": [],
15 | "source": []
16 | }
17 | ],
18 | "metadata": {
19 | "kernelspec": {
20 | "display_name": "Python 3",
21 | "language": "python",
22 | "name": "python3"
23 | },
24 | "language_info": {
25 | "codemirror_mode": {
26 | "name": "ipython",
27 | "version": 3
28 | },
29 | "file_extension": ".py",
30 | "mimetype": "text/x-python",
31 | "name": "python",
32 | "nbconvert_exporter": "python",
33 | "pygments_lexer": "ipython3",
34 | "version": "3.6.8"
35 | }
36 | },
37 | "nbformat": 4,
38 | "nbformat_minor": 4
39 | }
40 |
--------------------------------------------------------------------------------
/notebooks/intro-python-fundamentals.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Introduction to Python fundamentals"
8 | ]
9 | },
10 | {
11 | "cell_type": "code",
12 | "execution_count": null,
13 | "metadata": {},
14 | "outputs": [],
15 | "source": []
16 | }
17 | ],
18 | "metadata": {
19 | "kernelspec": {
20 | "display_name": "Python 3",
21 | "language": "python",
22 | "name": "python3"
23 | },
24 | "language_info": {
25 | "codemirror_mode": {
26 | "name": "ipython",
27 | "version": 3
28 | },
29 | "file_extension": ".py",
30 | "mimetype": "text/x-python",
31 | "name": "python",
32 | "nbconvert_exporter": "python",
33 | "pygments_lexer": "ipython3",
34 | "version": "3.6.8"
35 | }
36 | },
37 | "nbformat": 4,
38 | "nbformat_minor": 4
39 | }
40 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | jupyterlab==2.1.5
2 | numpy==1.18.2
3 | pandas==1.0.3
4 | pip==20.0.2
5 | matplotlib==3.2.2
--------------------------------------------------------------------------------
/unix-shell/a-folder/got-characters.txt:
--------------------------------------------------------------------------------
1 | Jon
2 | Arya
3 | Daenerys
4 |
--------------------------------------------------------------------------------
/unix-shell/a-folder/my-empty-file.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/unix-shell/a-folder/my-empty-file.txt
--------------------------------------------------------------------------------
/unix-shell/b-folder/a-folder/got-characters.txt:
--------------------------------------------------------------------------------
1 | Jon
2 | Arya
3 | Daenerys
4 |
--------------------------------------------------------------------------------
/unix-shell/cat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/unix-shell/cat
--------------------------------------------------------------------------------
/unix-shell/catbug.txt:
--------------------------------------------------------------------------------
1 | catbug
2 | Plum
--------------------------------------------------------------------------------
/unix-shell/characters-folder/.hidden-file.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/unix-shell/characters-folder/.hidden-file.txt
--------------------------------------------------------------------------------
/unix-shell/characters-folder/got-characters-copy.txt:
--------------------------------------------------------------------------------
1 | Jon
2 | Arya
3 | Daenerys
4 |
--------------------------------------------------------------------------------
/unix-shell/characters-folder/got-characters.txt:
--------------------------------------------------------------------------------
1 | Jon
2 | Arya
3 | Daenerys
4 |
--------------------------------------------------------------------------------
/unix-shell/characters-folder/harry-potter-characters.txt:
--------------------------------------------------------------------------------
1 | Harry
2 | Hermione
3 | Ron
4 |
--------------------------------------------------------------------------------
/unix-shell/empty.txt:
--------------------------------------------------------------------------------
1 | cat: nonexistent-file.txt: No such file or directory
2 |
--------------------------------------------------------------------------------
/unix-shell/first-command.txt:
--------------------------------------------------------------------------------
1 | this is my first command
2 |
--------------------------------------------------------------------------------
/unix-shell/fruits.txt:
--------------------------------------------------------------------------------
1 | apple
2 | pear
3 | peach
4 | grape
5 | kiwi
6 | melon
7 | fig
8 | cucumber
9 | cherry
10 | banana
11 | avocado
12 | coconut
13 | orange
14 | papaya
15 | watermelon
16 | mango
17 |
--------------------------------------------------------------------------------
/unix-shell/got-characters-copy.txt:
--------------------------------------------------------------------------------
1 | Jon
2 | Arya
3 | Daenerys
4 |
--------------------------------------------------------------------------------
/unix-shell/got-characters.txt:
--------------------------------------------------------------------------------
1 | Jon
2 | Arya
3 | Daenerys
--------------------------------------------------------------------------------
/unix-shell/harry-potter-characters.txt:
--------------------------------------------------------------------------------
1 | Harry
2 | Hermione
3 | Ron
4 |
--------------------------------------------------------------------------------
/unix-shell/my-empty-file-1.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/unix-shell/my-empty-file-1.txt
--------------------------------------------------------------------------------
/unix-shell/my-empty-file-2.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/unix-shell/my-empty-file-2.txt
--------------------------------------------------------------------------------
/unix-shell/my-empty-file-4.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/unix-shell/my-empty-file-4.txt
--------------------------------------------------------------------------------
/unix-shell/terminal-binder.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pabloinsente/intro-sc-python/d9647e15c9c4ee5728dca807e57d91f11c03fd30/unix-shell/terminal-binder.PNG
--------------------------------------------------------------------------------
/unix-shell/unix_shell.md:
--------------------------------------------------------------------------------
1 | # The UNIX Shell
2 |
3 | **TL;DR** sections:
4 |
5 | [What is the UNIX shel](#what-is-the-unix-shell)
6 |
7 | [Why to use the UNIX shell](#why-to-use-the-unix-shell)
8 |
9 | [A curated list of basic shell commands](#a-curated-list-of-basic-shell-commands)
10 |
11 | The rest of the content is really useful, but not strictly required to use the shell.
12 |
13 | **NOTE 1**: Apologies for typos and misspelled words in advance. This document has not been proofread (yet).
14 |
15 | **NOTE 2**: There is a GitHub repository ([here](https://github.com/pabloinsente/intro-sc-python)) associated with this tutorial that you can clone to follow along. You should also be able to recreate the contents of this tutorial in your own machine by simply typing everythin in the shell. If you are not comfortable using Git/Github, you still can read this as a conceptual introduction with examples.
16 |
17 | **NOTE FOR WINDOWS USERS**: As Windows is not an Unix-like or Linux-based system, most the commands and examples here won't work, as the Windows Command Prompt and the Windows Power Shell are not bash based. You have a couple of options to follow along:
18 |
19 | 1. downloading and installing terminal emulators like [GitBash](https://gitforwindows.org/) and [Cygwin](https://www.cygwin.com/)
20 | 2. to install the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
21 | 3. open the GitHub repository associated with this tutorial in the cloud environment provided by **MyBinder** by clicking the icon below. Once the environment is ready (it may take a couple of minutes to build), open a terminal there. To open a terminal simply go to "File -> New -> Terminal" or click on the "Terminal" icon under the "Other" section in the landing page. The file with this tutorial is in `unix-shell/` directory named as **unix_shell.md**
22 |
23 | **To open MyBinder** -> [](https://mybinder.org/v2/gh/pabloinsente/intro-sc-python/master/?urlpath=lab)
24 |
25 | If you are a beginner, [GitBash](https://gitforwindows.org/) and [Cygwin](https://www.cygwin.com/) should work just fine, and easier to set-up. The MyBinder environment is a good option too, but you won't be able to save your work. I do not advise trying (WSL) unless you feel comfortable with using the terminal already. Yet, WSL is the best long-term solution for Windows users.
26 |
27 | ## Table of contents
28 |
29 | - [What is the UNIX shel](#what-is-the-unix-shell)
30 | - [Why to use the UNIX shell](#why-to-use-the-unix-shell)
31 | - [Shell syntax basics](#shell-syntax-basics)
32 | - [Standard input, output, and error](#standard-input-output-and-error)
33 | - [Shell commands basics](#shell-commands-basics)
34 | - [Single commands](#single-commands)
35 | - [Composed commands](#composed-commands)
36 | - [A curated list of basic shell commands](#a-curated-list-of-basic-shell-commands)
37 | - [Basic commands](#basic-commands)
38 | - [File commands](#file-commands)
39 | - [Directory commands](#directory-commands)
40 | - [System commands](#system-commands)
41 |
42 | ## What is the UNIX shell
43 |
44 | We begin our journey with the UNIX shell, that cryptic program that runs in your terminal enabling you to do all sort of tasks in your computer. The UNIX shell is a program to *interface* with the lowest level of UNIX-based operating systems (i.e., the *kernel*). If you are running any Mac OS or Linux Distribution, you are using a *UNIX-based* or *Unix-like* operating system. UNIX-based operating systems have two main parts: the *kernel* and the *utilities*. The *kernel* is the program managing and allocating the resources of the computer hardware (i.e., the Central Processing Unit or CPU, the Random Access Memory or RAM, and devices like the mouse, speaker, etc). It is a *software layer* facilitating the control of the computer hardware. The *utilities* are a set of commands to interface with the kernel. For instance, if you type `pwd` in your terminal, the kernel will load a program called `pwd` into the RAM, read the program instructions, and display the output, in this case, the current working directory path.
45 |
46 | The so-called *shell*, also happens to be a UNIX utility program. It has a dual identity: as a *user interface* to the UNIX utilities, and as a *programming language* facilitating the usage and combination of the UNIX utilities. When you open the terminal, the shell program is loaded into the computer memory. When you type commands in the terminal, the shell reads the commands and converts them into a format that is readable by the kernel to be executed. It provides an interactive instance to start programs, manage files, and processes running in the computer. Since the shell is just a program, many variations have been created since 1969, when [Ken Thompson](https://en.wikipedia.org/wiki/Ken_Thompson) developed the the first UNIX implementation at [Bell Labs](https://en.wikipedia.org/wiki/Bell_Labs). The original UNIX shell was written by [Steve Bourne](https://en.wikipedia.org/wiki/Stephen_R._Bourne) in 1970, and it's known as *Bourne shell* or *sh*. The Bourne shell was not available for free at the time, which limited its usage by other programmers. To alleviate this problem, in 1988, the Free Software Foundation tasked [Brian Fox](https://en.wikipedia.org/wiki/Brian_Fox_(computer_programmer)) to develop an open-source reimplementation of the Bourne shell, the so-called *Bourne again shell* or *bash*. Today, the *bash* shell is probably the most widely use implementation of the Unix shell, and the one that serves as a base for us.
47 |
48 | ## Why to use the UNIX shell
49 |
50 | If you haven't use the shell before, you're probably accustomed to interact with computer software via *Graphical User Interfaces* or a *GUI*. This is perfectly fine for most day to day task, but in a research context, there are many important capabilities that GUI interfaces do not provide. In particular, there are a few key capabilities that I want to highlight:
51 |
52 | - **Repetition**: there are situations when you want to repeat the same action multiple times, sometimes hundreds or thousands of times, actions like changing the extension of a large batch of files or extracting the last line of multiple text files. Repeating these actions thousands of times with a GUI is beyond unpractical (and probably bad for your health too), and here is where the shell thrives. For example, changing thousands of files with a *.txt* extension to a *.md* extension can be accomplished with a single line like this one:
53 |
54 | ```bash
55 | ➜ rename "s/txt/md/" *.txt
56 | ```
57 |
58 | ***HEADS UP***: In the code blocks, you see will see a `➜` as a *prompt* before the actual command. Anything below that indicates the output printed to the terminal. Some commands do not print to the terminal. For instance:
59 |
60 | ```bash
61 | # With standard output to the terminal
62 | ➜ [shell-command] [ARGUMENT(s)]
63 | some standard output
64 |
65 | # Without standard output to the terminal
66 | ➜ [shell-command] [ARGUMENT(s)]
67 | ```
68 |
69 | If you copy the instructions to your terminal, remember to delete or ignore the ➜ symbol. Your terminal may have **$** symbol or some other character as a prompt, indicating that the terminal is ready to receive input.
70 |
71 | - **Automation**: sometimes, instead of repeating the same action, you may want to repeat sequences of actions, or maybe just a single long and complicated action. You may also need to trigger an action automatically in response to some process in your computer. In either case, using the GUI makes you more error prone and slower. Writing the instructions in a *shell script*, a text file with sequences of shell commands, can facilitate these tasks.
72 |
73 | - **Reproducibility**: the fact that you can type sequences of instructions in shell scripts, makes extremely easy to *exactly* reproduce steps in data processing pipelines. Alternatively, you could take snapshots of your GUI and provide lengthy instructions of what to point and click at every step, but that would take more effort, more time, and increase the probability of error.
74 |
75 | - **Remote server connection**: if you ever need to connect to another computer from your computer, this is, a *remote server*, you will have to use the shell. For instance, *High-performance computing* (HPC), *High-throughput computing* (HTC), and *Amazon Web Services* (AWS), are all forms of remote computing that require the users to connect and interact via shell commands.
76 |
77 | ## Shell syntax basics
78 |
79 | When you pass commands to the terminal, *roughly* speaking, the shell performs the following set of operations:
80 |
81 | - If you pass starting with the '#' symbol, the shell will ignore that as a '*comment*' (i.e., it won't do nothing). Comments are usually used in shell scripts rather than in interactive mode, as descriptors of the action to be taken.
82 |
83 | - If you pass commands without the '#' symbol, the shell reads the inputs and divides them into '*words*' and '*operators*'. By *words* we mean any commands like `cd` (change directory) or `cat` (concatenate files to standard output), plus other constructs related to the specific command; by *operators* we mean arithmetic operators (like `+` or `-`) , relational operators (like `-eq` or `-ne`), boolean operators (like `-o` or `!`), string operators(like `!=` or `=`), or file operators (like `-b` or `c`).
84 |
85 | - Then, the shell parse the words and operators into subtypes, performs a series of intermediate steps like expansions and redirections, to finally execute the commands instructions.
86 |
87 | ## Standard input, output, and error
88 |
89 | Before moving into more applied topics, I want to briefly review the concepts of standard input, standard output, and standard error, as I will use them constantly in this tutorial.
90 |
91 | Linux or unix-like systems have what is known as "standard streams of data". Any process run in such systems is initialized with three data streams: *standard input*, *standard ouput*, and *standard error*. By data we mean instructions in plain text formart.
92 |
93 | **Standard input** or "stdin", referes the "place" where programs or processes *get* information from. By default, the shell "takes" input from the keyboard. In other words, standard input is the default place and source of information for Linux/Bash programs.
94 |
95 | **Standard output** or "stdout", referes the "place" where programs or processes *send* information to. By default, the shell output will be directed to the screen or monitor (i.e., printed in the terminal), but it can also for to a text file or a printer. In other words, standard outut is the default place where information is send after processing.
96 |
97 | **Standard error** or "stderr", referes the "place" where programs or processes *send* errors. By default, the shell output will be directed to the screen or the monitor(i.e., printed in the terminal). In other words, standard error is the default place where the shell send messages about processes that went wrong.
98 |
99 | Knowing this concepts will make undertanding bash documentation much easier.
100 |
101 | ## Shell commands basics
102 |
103 | Broadly speaking, there two types of shell commands: *single* commands and *composed* commands.
104 |
105 | ### Single commands
106 |
107 | Single commands are a combination of the command itself, a blank space, a the command arguments. For instance:
108 |
109 | ```bash
110 | ➜ ls -a
111 | ```
112 |
113 | Here we have:
114 |
115 | - `ls` : the command to list information about files
116 | - A white space
117 | - `-a` : an argument saying "do not ignore files starting with ." (hidden files).
118 |
119 | ### Composed commands
120 |
121 | Composed commands are created by combining simple commands into *pipelines*, *lists*, *compounds*, and *coproceses*. We will examine the first three, as are the ones more commonly used.
122 |
123 | #### Pipeline
124 |
125 | A pipeline is a sequence of one or more commands separated by one of the control operators ‘|’ or ‘|&’, where the *output* of the first command becomes the *input* of the next. For instance:
126 |
127 | ```bash
128 | ➜ ls -l | grep ".txt"
129 | ```
130 |
131 | The `ls` command list the files in the current directory, and the `grep` command will print the lines matching the ".txt" extension to the terminal.
132 |
133 | #### Lists
134 |
135 | Lists are a sequence of one or more pipelines separated by one of the operators ‘;’, ‘&’, ‘&&’, or ‘||’. For instance:
136 |
137 | ```bash
138 | ➜ ls | grep ".txt" && ls | grep ".csv"
139 | ```
140 |
141 | The pipeline on the left side of *&&* will print the files matching the ".txt" , and the pipeline on the right side, will print the files matching the ".csv" extension, only if the left side was executed successfully.
142 |
143 | #### Compound commands
144 |
145 | Compound commands are shell programming constructs that allow for more complex operations, particularly related to control flow. Compound commands are further divided into: looping constructs, conditional constructs, and grouping constructs. This type of commands begin with a reserved keyword indicating the beginning of the processes, and another keyword to indicate the end. For instance:
146 |
147 | ```bash
148 | ➜ while test-commands; do consequent-commands; done
149 | ```
150 |
151 | This will tell the shell to repeat certain action (*consequent-commands*), while some other condition is true (*test-commands*). The `while` keyword indicates the beginning, and the `done` keyword indicate the end.
152 |
153 | ## A curated list of basic shell commands
154 |
155 | Now that we have enough background knowledge about the inner workings of the shell, we will review a list of the, in my opinion, most useful commands in a research context. This is the most important and practical part of this tutorial. I don't pretend to be exhaustive here. More commands will be introduced in later sections.
156 |
157 | ***HEADS UP***: In case you use the GitHub repository to follow the examples, be aware the exact output showed here may be different, given that this is a project in constant development. However, the instructions and command description hold true.
158 |
159 | ### Basic commands
160 |
161 | #### `echo`
162 |
163 | The `echo` command display text in the terminal. Is often used in combination with other operators to pass information to a file.
164 |
165 | ##### Simple display
166 |
167 | ```bash
168 | ➜ echo this is my first command
169 | this is my first command
170 | ```
171 |
172 | ##### Combining to pass text to a file
173 |
174 | This line will pass the text into the file, instead of printing in the terminal
175 |
176 | ```bash
177 | ➜ echo this is my first command >> first-command.txt
178 | ```
179 |
180 | #### `clear`
181 |
182 | The `clear` command clears the terminal. It is often the case the your terminal will get cluttered with information, which can make things confusing to work with, so clearing often it is useful.
183 |
184 | ```bash
185 | ➜ clear
186 | ```
187 |
188 | #### `man`
189 |
190 | The `man` command allows you to access the on-line reference manual in the terminal. Any time that you want to learn anything about any command, `man` will help you.
191 |
192 | The basic syntax is `man [NAME OF THE COMMAND]`.
193 |
194 | For instance you can learn about the `man` command itself by
195 |
196 | ```bash
197 | ➜ man man
198 | MAN(1) Manual pager utils MAN(1)
199 |
200 | NAME
201 | man - an interface to the on-line reference manuals
202 |
203 | ...
204 | ```
205 |
206 | #### `help`
207 |
208 | Technically, `help` is not a command, but an option for most commands. I'm including this here because along with `man` is one of the most handy tools to learn about and use bash. You can think on `help` as quicker way to look at the documentation.
209 |
210 | For instance, to learn more about `man`
211 |
212 | ```bash
213 | ➜ man --help
214 | Usage: man [OPTION...] [SECTION] PAGE...
215 |
216 | -C, --config-file=FILE use this user configuration file
217 | -d, --debug emit debugging messages
218 | -D, --default reset all options to their default values
219 | --warnings[=WARNINGS] enable warnings from groff
220 | ...
221 | ```
222 |
223 | ### File commands
224 |
225 | There are some operations that you can perform with files, like text files, comma separated files, and others.
226 |
227 | #### `ls`
228 |
229 | The `ls` command *list directory contents*.
230 |
231 | The syntax is: `ls [OPTION(s)] [FILE(s)]`
232 |
233 | ##### List directory contents
234 |
235 | The simples action is to list the contents in the current directory by `ls`
236 |
237 | ```bash
238 | ➜ ls
239 | a-folder characters-folder got-characters.txt __init__.py
240 | b-folder got-characters-copy.txt harry-potter-characters.txt unix_shell.md
241 | ```
242 |
243 | ##### List directory contents including files starting with '.'
244 |
245 | Hidden files usually begin with a dot in UNIX-bases systems. To list them along with the visible files you need to add the `-a` option. Here I'm adding `./characters-folder` to list the contents in that directory instead of the current one.
246 |
247 | ````bash
248 | ➜ ls -a ./characters-folder
249 | . got-characters-copy.txt harry-potter-characters.txt
250 | .. got-characters.txt .hidden-file.txt
251 | ````
252 |
253 | ##### List directory contents in long format
254 |
255 | Listing in long format reveals detailed information about each file. To do this we add the `-l` option
256 |
257 | ```bash
258 | ➜ ls -l
259 | drwxr-xr-x 3 pablo pablo 4096 Feb 8 15:33 b-folder
260 | drwxr-xr-x 2 pablo pablo 4096 Feb 8 15:40 characters-folder
261 | -rw-r--r-- 1 pablo pablo 18 Feb 8 15:23 got-characters-copy.txt
262 | -rw-rw-r-- 1 pablo pablo 18 Feb 8 12:53 got-characters.txt
263 | -rw-r--r-- 1 pablo pablo 19 Feb 8 15:06 harry-potter-characters.txt
264 | -rw-r--r-- 1 pablo pablo 0 Feb 8 12:43 __init__.py
265 | -rw-r--r-- 1 pablo pablo 11515 Feb 8 15:46 unix_shell.md
266 | ```
267 |
268 | There is a lot of information here. Let's examine this part by part:
269 |
270 | - The first character indicates the [file type](https://en.wikipedia.org/wiki/Unix_file_types). In this example is `d` for directory or `-` for regular file. There are more types that you can look up on-line.
271 | - The next nine characters indicate file permissions.
272 | - *Characters 1-3*, are for the *user*. Here `-rw` means *reading* and *writing* permissions
273 | - *Characters 4-6* are for the *group*. Here `-r-` means *reading* permission only
274 | - Characters 7-9 are for *others*. Here `-r-` means *reading* permission only
275 | - The number after the permission string indicates the the number of [hard links](https://en.wikipedia.org/wiki/Hard_link) to the file
276 | - Next, the `pablo pablo` indicates the *file owner* and the *group*, respectively.
277 | - The number after the group name, indicates the file size in bytes.
278 | - Next, the `Feb 8 15:33` indicates the *date* and *time* of the *last modification* to the file.
279 | - Finally, the last column display the file name.
280 |
281 | ##### List directory contents by custom order
282 |
283 | The `ls` command will sort files alphabetically by default. You can use the `--sort=KEYWORD` to sort files by *size*, *time*, *version*, *extension*.
284 |
285 | ```bash
286 | # sort by size
287 | ➜ ls -l --sort=size
288 | total 40
289 | -rw-r--r-- 1 pablo pablo 13396 Feb 8 16:09 unix_shell.md
290 | drwxr-xr-x 2 pablo pablo 4096 Feb 8 15:25 a-folder
291 | drwxr-xr-x 3 pablo pablo 4096 Feb 8 15:33 b-folder
292 | drwxr-xr-x 2 pablo pablo 4096 Feb 8 15:40 characters-folder
293 | -rw-r--r-- 1 pablo pablo 19 Feb 8 15:06 harry-potter-characters.txt
294 | -rw-r--r-- 1 pablo pablo 18 Feb 8 15:23 got-characters-copy.txt
295 | -rw-rw-r-- 1 pablo pablo 18 Feb 8 12:53 got-characters.txt
296 | -rw-r--r-- 1 pablo pablo 0 Feb 8 12:43 __init__.py
297 | # sor by time
298 | ➜ ls -l --sort=time
299 | total 40
300 | -rw-r--r-- 1 pablo pablo 13396 Feb 8 16:09 unix_shell.md
301 | drwxr-xr-x 2 pablo pablo 4096 Feb 8 15:40 characters-folder
302 | drwxr-xr-x 3 pablo pablo 4096 Feb 8 15:33 b-folder
303 | drwxr-xr-x 2 pablo pablo 4096 Feb 8 15:25 a-folder
304 | -rw-r--r-- 1 pablo pablo 18 Feb 8 15:23 got-characters-copy.txt
305 | -rw-r--r-- 1 pablo pablo 19 Feb 8 15:06 harry-potter-characters.txt
306 | -rw-rw-r-- 1 pablo pablo 18 Feb 8 12:53 got-characters.txt
307 | -rw-r--r-- 1 pablo pablo 0 Feb 8 12:43 __init__.py
308 | ```
309 |
310 | #### `cat`
311 |
312 | The `cat` command *concatenates and print contents of a file to standard output* (I know, confusingly, it has nothing to do with cats).
313 |
314 | The syntax is: `cat [OPTION(s)] [FILE(s)]`
315 |
316 | ##### Display file's contents
317 |
318 | ```bash
319 | ➜ cat harry-potter-characters.txt
320 | Harry
321 | Hermione
322 | Ron
323 | ```
324 |
325 | ##### Display multiple file's contents
326 |
327 | ```bash
328 | ➜ cat got-characters.txt
329 | Harry
330 | Hermione
331 | Ron
332 | Jon
333 | Arya
334 | Daenerys
335 | ```
336 |
337 | ##### Display numerated file's contents
338 |
339 | ```bash
340 | ➜ cat -n got-characters.txt
341 | 1 Jon
342 | 2 Arya
343 | 3 Daenerys
344 | ```
345 |
346 | ##### Create a new file concatenating standard input text
347 |
348 | This will prompt you to enter input text. You type some text and press `enter`. Once you are done, press `Control + D` to exit.
349 |
350 | ```bash
351 | ➜ cat >new-characters.txt
352 | Dumbledore
353 | Voldemort
354 | Jaime
355 | Tyrion
356 | ```
357 |
358 | Now, if you type `cat new-characters.txt` the list of names will be printed in the terminal.
359 |
360 | #### `cp`
361 |
362 | The `cp` command *copy files and directories*.
363 |
364 | The syntax is: `cp [OPTION(s)][SOURCE] [DESTINY]`
365 |
366 | ##### Copy contents of a file into another
367 |
368 | ```bash
369 | cp got-characters.txt got-characters-copy.txt
370 | ```
371 |
372 | If you `cat` the contents of `got-characters-copy.txt` you will see the duplicated contents
373 |
374 | ##### Copy a file from one directory into another
375 |
376 | ```bash
377 | cp got-characters.txt ./a-folder
378 | ```
379 |
380 | ##### Copy a directory into another
381 |
382 | ```bash
383 | cp -r /a-foler ./b-folder
384 | ```
385 |
386 | The `-r` option stand for *recursive*. This option is required to copy directories.
387 |
388 | #### `touch`
389 |
390 | The `touch` command changes files timestamps. However, `touch` is commonly used to create new empty files.
391 |
392 | To change timestamps of an *existing* *file* the syntax is `touch [OPTION(s)] [FILE(s)]`
393 |
394 | To create an *new empty file* the syntax is `touch [FILE(s)]`
395 |
396 | ##### Change the time-stamp of an existing file
397 |
398 | First, I'll review the access and modification times using the `stat` command, to then use the `touch` command to change those times, and finally `stat` again to verify the changes.
399 |
400 | ```bash
401 | # review access time and modification time
402 | ➜ stat harry-potter-characters.txt
403 | File: harry-potter-characters.txt
404 | Size: 19 Blocks: 8 IO Block: 4096 regular file
405 | Device: 10307h/66311d Inode: 3440036 Links: 1
406 | Access: (0644/-rw-r--r--) Uid: ( 1000/ pablo) Gid: ( 1000/ pablo)
407 | Access: 2020-02-08 15:39:41.039475209 -0600
408 | Modify: 2020-02-08 15:06:40.426141133 -0600
409 | Change: 2020-02-08 15:06:40.426141133 -0600
410 | Birth: -
411 |
412 | # change access and modficiation time
413 | touch -am harry-potter-characters.txt
414 |
415 | # review access time and modification time after change
416 | ➜ stat harry-potter-characters.txt
417 | File: harry-potter-characters.txt
418 | Size: 19 Blocks: 8 IO Block: 4096 regular file
419 | Device: 10307h/66311d Inode: 3440036 Links: 1
420 | Access: (0644/-rw-r--r--) Uid: ( 1000/ pablo) Gid: ( 1000/ pablo)
421 | Access: 2020-02-08 17:37:05.054635614 -0600
422 | Modify: 2020-02-08 17:37:05.054635614 -0600
423 | Change: 2020-02-08 17:37:05.054635614 -0600
424 | Birth: -
425 | ```
426 |
427 | Here, the `-a` and `-m` options change the *access time* and *modification time*, respectively. If you compare the `Access` and `Modify` entries from the top and the bottom of the code block, you'll see the changes.
428 |
429 | ##### Create a new empty file
430 |
431 | ```bash
432 | ➜ touch my-empty-file.txt
433 | ```
434 |
435 | This is the most common use of the touch command. You can create multiple empty files by:
436 |
437 | ```bash
438 | ➜ touch my-empty-file-1.txt my-empty-file-2.txt my-empty-file-3.txt
439 | ```
440 |
441 | #### `mv`
442 |
443 | The `mv` command moves files around your file system, and it is also used to rename files.
444 |
445 | The syntax to move files is: `mv [OPTION(s)]] [SOURCE] [DESTINY]`
446 |
447 | The syntax to rename a file is: `mv [OPTION(s)] [CURRENT NAME] [WANTED NAME]`
448 |
449 | ##### Moving a file
450 |
451 | ```bash
452 | ➜ mv my-empty-file.txt ./a-folder
453 | ```
454 |
455 | Notice that here you can use either absolute or relative paths.
456 |
457 | ##### Renaming a file
458 |
459 | ```bash
460 | ➜ mv my-empty-file-3.txt my-empty-file-4.txt
461 | ```
462 |
463 | #### `grep`
464 |
465 | The `grep` command print lines matching a desired pattern given some standard input. By standard input, we mean content printed to the terminal or a file. This is one of the most handy command line tools in bash, particularly when combined with other tools like `ls` , `find`, and [regular expressions]('https://en.wikipedia.org/wiki/Regular_expression'). The `grep` documentation is very extensive, and it can be treated as a topic in itself one combined with regular expression. Here we will review a few of the main `grep` functions.
466 |
467 | The syntax for basic pattern matching is `grep [OPTION(s)] [PATTERN] [FILE(s)]`
468 |
469 | The syntax for pattern matching as extended regular expressions is `grep [OPTION(s)] -e [PATTERN] [FILE(s)]`
470 |
471 | The syntax for pattern matching using the `[PATTERN]` as a list of fixed string (instead of regular expression) is `grep [OPTION(s)] -f [STRING] [FILE(s)]`
472 |
473 | ##### Basic pattern matching
474 |
475 | ```bash
476 | ➜ grep Harry harry-potter-characters.txt
477 | Harry
478 | ➜ grep Jon got-characters.txt
479 | Jon
480 | ```
481 |
482 | ##### Extended regular expression pattern matching
483 |
484 | In Linux, there is no difference between basic and extended pattern matching. In other system, it may be the case that basic pattern matching is not as general and powerful as extended pattern matching. If you are in need of using complex regular expression patterns to search, you may need to add the `e` option for that to work. I'll not cover this option now since regular expressions knowledge is required.
485 |
486 | ##### String pattern matching
487 |
488 | The difference between basic pattern matching and string pattern matching, is that the latter does not use regular expression rules to search. For instance, suppose you want to search something like `.*` in a file:
489 |
490 | ```bash
491 | # pattern matching with regular expressions
492 | ➜ grep "\.\*" filename
493 | # pattern matching with strings
494 | ➜ grep -F ".*" filename
495 | ```
496 |
497 | In the pattern matching case you have to add the backslash [escape character](https://en.wikipedia.org/wiki/Escape_character) to prevent the interpretation of the `*` as a [wildcard character](https://en.wikipedia.org/wiki/Wildcard_character). In the string search case, the `.*` is interpreted literally, so no escape character is needed.
498 |
499 | ##### Using the output of another command as `grep` input
500 |
501 | The `grep` command is often used in combination with others bash tools. For instance, we can list all the files in the current directory with `ls`, then pass the output as input to `grep`, and search for all files containing the string "got".
502 |
503 | ```bash
504 | ➜ ls | grep got
505 | got-characters-copy.txt
506 | got-characters.txt
507 | ```
508 |
509 | `wc`
510 |
511 | The `wc` command prints how many new lines, words, and bytes are in file.
512 |
513 | The basic syntax is `wc [OPTION(s)] [FILE]`
514 |
515 | ##### Basic count
516 |
517 | ```bash
518 | ➜ wc got-characters.txt
519 | 3 3 18 got-characters.txt
520 | ```
521 |
522 | In order, this is 3 words, 3 new lines, and 18 bytes.
523 |
524 | ##### Count words only
525 |
526 | ```bash
527 | ➜ wc -w got-characters.txt
528 | 3 got-characters.txt
529 | ```
530 |
531 | ##### Count new lines only
532 |
533 | ```bash
534 | ➜ wc -w got-characters.txt
535 | 3 got-characters.txt
536 | ```
537 |
538 | ##### Count the number of characters
539 |
540 | ```bash
541 | ➜ wc -m got-characters.txt
542 | 18 got-characters.txt
543 | ```
544 |
545 | ##### Count the number of bytes
546 |
547 | ```bash
548 | ➜ wc -c got-characters.txt
549 | 18 got-characters.txt
550 | ```
551 |
552 | #### `head`
553 |
554 | The `head` command prints the first elements of a file, by default, the first 10 elements.
555 |
556 | The basic syntax is `head [OPTION] [FILE]`
557 |
558 | ##### Printing the first 10 lines of a file
559 |
560 | ```bash
561 | ➜ head fruits.txt
562 | apple
563 | pear
564 | peach
565 | grape
566 | kiwi
567 | melon
568 | fig
569 | cucumber
570 | cherry
571 | banana
572 | ```
573 |
574 | ##### Printing the first n number of lines of a file
575 |
576 | You can print an arbitrary number `n` of lines in a file by using th `n` option.
577 |
578 | ```bash
579 | ➜ head -n 5 fruits.txt
580 | apple
581 | pear
582 | peach
583 | grape
584 | kiwi
585 | ```
586 |
587 | ##### Printing the first n number of bytes of a file
588 |
589 | You can print an arbitrary number `n` of bytes in a file by using th `-c` option.
590 |
591 | ```bash
592 | ➜ head -c 20 fruits.txt
593 | apple
594 | pear
595 | peach
596 | ```
597 |
598 | ##### `tail`
599 |
600 | The `tail` command prints the last elements of a file, by default, the last 10 elements.
601 |
602 | The basic syntax is `tail [OPTION] [FILE]`
603 |
604 | ##### Printing the last 10 lines of a file
605 |
606 | ```bash
607 | ➜ tail fruits.txt
608 | cucumber
609 | cherry
610 | banana
611 | avocado
612 | coconut
613 | orange
614 | papaya
615 | watermelon
616 | mango
617 | ```
618 |
619 | ##### Printing the last n lines of a file
620 |
621 | ```bash
622 | ➜ tail -n 5 fruits.txt
623 | coconut
624 | orange
625 | papaya
626 | watermelon
627 | mango
628 | ```
629 |
630 | ##### Printing the last n number of bytes of a file
631 |
632 | You can print an arbitrary number `n` of bytes in a file by using th `-c` option.
633 |
634 | ```bash
635 | ➜ tail -c 20 fruits.txt
636 | ya
637 | watermelon
638 | mango
639 | ```
640 |
641 | #### `rm`
642 |
643 | The `rm` command removes files or directories. This another very important and useful shell tool.
644 |
645 | The basic syntax is `rm [OPTION(s)] [FILE]`
646 |
647 | ##### Removing a single file
648 |
649 | ```bash
650 | ➜ rm my-empty-file-4.txt
651 | ```
652 |
653 | You won't see any printed output but you can check the file has been removed with `ls`.
654 |
655 | ##### Removing multiple files
656 |
657 | ```bash
658 | ➜ rm my-empty-file-1.txt my-empty-file-2.txt
659 | ```
660 |
661 | ##### Removing a directory
662 |
663 | `rm` alone won't work this time. The `-r` flag ("recursively") must be added.
664 |
665 | ```bash
666 | # create an empty folder as example
667 | ➜ mkdir empty-dir
668 | ➜ rm -r empt-dir
669 | ```
670 |
671 | ### Directory commands
672 |
673 | Directory commands are actions you can perform with folders or directories.
674 |
675 | #### pwd
676 |
677 | The `pwd` prints the current workind directory to the terminal.
678 |
679 | The basic syntax is `pwd [OPTION(s)]`
680 |
681 | ```bash
682 | # you will see your own full path printed out to the terminal
683 | ➜ pwd
684 | /mnt/c/Users/pablo/Desktop/projects/unix_shell
685 | ```
686 |
687 | #### cd
688 |
689 | The `cd` command changes the current working directory to another.
690 |
691 | The basic syntax is `cd [OPTION(s)] [DIRECTORY]`
692 |
693 | ##### Move to an specific folder "down"
694 |
695 | ```bash
696 | # move from current directory to characrers-folder/
697 | ➜ cd characters-folder/
698 | ```
699 |
700 | ##### Move one folder up
701 |
702 | ```bash
703 | # move back from characrers-folder/ to unix_shell/
704 | ➜ cd ..
705 | ```
706 |
707 | ##### Move two folders up
708 |
709 | ```bash
710 | # go back to unix_shell/ first
711 | ➜ cd unix_shell/
712 | # move back from unix_shell/ to repo-directory
713 | ➜ cd ../..
714 | ```
715 |
716 | You can follow the patten of `../` to move several directories up.
717 |
718 | ##### Move the home directory
719 |
720 | ```bash
721 | # this is no mistake, cd alone would change the directory to home
722 | ➜ cd
723 | ```
724 |
725 | #### mkdir
726 |
727 | The `mkdir` command creates a new directory.
728 |
729 | The basic syntax is `mkdir [OPTION(s)] [DIRECTORY-NAME]`
730 |
731 | ##### Make a single directory
732 |
733 | ```bash
734 | ➜ mkdir my-folder
735 | ```
736 |
737 | ##### Make multiple directories
738 |
739 | ```bash
740 | ➜ mkdir my-folder-2 my-folder-3
741 | ```
742 |
743 | You can create as many directories as you need "below" the current working directory by following the same patter
744 |
745 | ### System commands
746 |
747 | #### ps
748 |
749 | The `ps` command prints a snapshot of the corrent active processes to the terminal. This command has many options which are useful for system administrators and othes. For our purposes, just knowing `ps` does that is enough.
750 |
751 | The basic syntax is `ps [OPTION(s)]`
752 |
753 | ```bash
754 | # your output will differ depending on your active processes
755 | ➜ ps
756 | PID TTY TIME CMD
757 | 8 pts/0 00:00:01 zsh
758 | 1042 pts/0 00:00:00 ps
759 | ```
760 |
761 | #### kill
762 |
763 | The `kill` command terminates an active process.
764 |
765 | The basic syntax is `kill PID` or `kill -s signalName PID`
766 |
767 | The PID is the process identification number. You can find the PID of a process with the `ps` command.
768 |
769 | ```bash
770 | kill PID
771 | ```
772 |
773 | Here is an example of when I have used `kill`: I closed a Jupyter Notebook session by typying `Ctrl` + `Z` in the terminal, instead of `Ctrl` + `C`. Sometimes happens that if you try launch Jupyter again won't work because the default port is in use. Then you have to terminate the process Jupyter process, which is still running in the background, to be able to launch Jupyter again.
774 |
775 | #### top
776 |
777 | #### whoami
778 |
779 | The `whoami` command prints the current user id to the terminal.
780 |
781 | The basic syntax is `whoami [OPTION's]`
782 |
783 | ```bash
784 | # here you will see your used id
785 | ➜ whoami
786 | pablo
787 | ```
788 |
789 | ### Input/Output redirection commands
790 |
791 | As I explained before, the unix shell has three streams of data: input, output, and error messages. Such information can be redirected before execution. An example is the pipeline `|` that we reviewd in the composed commands section.
792 |
793 | #### Redirection operators
794 |
795 | Redirection operators are special characters used for change the direction in which streams of data flow. They can be located before or in between commands. Here is a list of several common operators.
796 |
797 | ##### Redirecting input
798 |
799 | To redirect input we use the `<` operator as:
800 |
801 | ```bash
802 | ➜ cat < got-characters.txt
803 | Jon
804 | Arya
805 | Daenerys
806 | ```
807 |
808 | The `cat` command is "fed" with the text file as input.
809 |
810 | ##### Redirecting output
811 |
812 | To redirect output we use the `>` operator as:
813 |
814 | ```bash
815 | ➜ echo "catbug" > catbug.txt
816 | ```
817 |
818 | This will cause the outut of `echo "catbug"` to be directed towards the catbug.txt. You can check that printing the catbug.txt contents.
819 |
820 | ##### Appending redirected output
821 |
822 | To append output we use the `>>` operator as:
823 |
824 | ```bash
825 | ➜ echo "Plum" >> catbug.txt
826 | ```
827 |
828 | This will cause to append (i.e., print at the end) the output of `echo "Plum"` , to the catbug.txt file. If you use `>` instead, the contents will be replaced rather than appended. This is you will get only:
829 |
830 | ```bash
831 | Plum
832 | ```
833 |
834 | Instead of:
835 |
836 | ```bash
837 | catbug
838 | Plum
839 | ```
840 |
841 | ##### Redirecting standard output and error
842 |
843 | There are instances where in addition to the output of a process, you may want to print any error messages generated for something that went wrong. An example of this is running long processes, which may take hours, which you leave unattended. if something goes wrong while you are away, having the error messages printed to a text file may be very useful to fix your code later.
844 |
845 | This action is done with the `&>` operator as:
846 |
847 | ```bash
848 | cat nonexistent-file.txt &> empty.txt
849 | ```
850 |
851 | The empty.txt file now must contain the "cat: nonexistent-file.txt: No such file or directory" message. If you use `>` instead, the error message will be printed to the terminal, and the empty.txt file will be empty.
852 |
853 | [back to top](#the-unix-shell)
854 |
855 | ## Future sections
856 |
857 | This tutorial is not complete. I was not planning to release this yet, but it became necessary to help out some students to learn shell basics. These are the topics I hope to cover later.
858 |
859 | - Shell functions basics
860 | - Shell variables basics
861 | - Shell flow control basics
862 | - Shell pattern matching basics
863 | - Shell scripting basics
864 | - Alternative shells
865 | - Additional resources to learn
866 |
867 | [back to top](#the-unix-shell)
--------------------------------------------------------------------------------