Docsity

Data Analysis with Pandas and NumPy – Beginner to Intermediate Guide, Study notes of Computer Science

Partial preview of the text

Download Data Analysis with Pandas and NumPy – Beginner to Intermediate Guide and more Study notes Computer Science in PDF only on Docsity!

>| || (Gmport pandas as pa] | NumPy: Doing Math Broadcasting | arr .mean () |— 2.5 | arr.max() | —P 4 [arr.min() | — > i A\ NotebookLM NumPy: The Slice & Dice . Stop index is excluded. | Masking | arr[arr > 20) | L Logic filter. A\ NotebookLM Input /Output (1/0) .| pd.read_csv('data.csv') . ; | df .to_csv('output.csv', City pd. read_excel ('data.x1sx') |. .. ind le x=rFalse ) - Prevents writing row - numbers to file! Filterin &\ NotebookLM | - Annes i =| (224 oe Le | Gow Bash ‘frie! | | 'Mike'_[= Anno! esse ‘Tohn'’ [== ee y #| TES ) Instant Ste dict ele Summary, Organize: Sort - Ravens. oe iat 2 CF a yet lier sort _values (’ Age’ Ji, Ree Top 5 Remember-This Notes __ an — —<—<——— —— 5 up)\/ (pandas as pa’) | icing ‘Istart:stop]’ | 1. Imports: Always \‘import numpy 2 | 2. Indexing: Python starts at 0. sl | excludes the stop: \ 3, Axis Logic: Ro Columns = axis 1. | 4. Changes: Use ‘inplace=True’ or reassign “df = --- to save changes. a . When in doubt, check ‘df info()’ and ‘df describe.’ ‘af describe’. ae eee aan oer ws = axis 0, i. | 5. Help a Good luck with the code! A\ NotebookLM