Browse Source

update

master
Joerg Marks 2 years ago
parent
commit
f5a433c43d
  1. 47
      notebooks/01_intro_ex_1b_sol.ipynb
  2. 335
      notebooks/01_intro_ex_2_sol.ipynb
  3. 27
      slides/01_intro_python.md

47
notebooks/01_intro_ex_1b_sol.ipynb
File diff suppressed because one or more lines are too long
View File

335
notebooks/01_intro_ex_2_sol.ipynb
File diff suppressed because one or more lines are too long
View File

27
slides/01_intro_python.md

@ -902,6 +902,33 @@ The basic indexable objects are
```
\normalsize
##
\setbeamertemplate{itemize item}{\color{red}\tiny$\blacksquare$}
* Selecting data of pandas objects continued
\vspace{0.5cm}
* More operations
\footnotesize
```python
df.drop(['col1', 'col2'], axis=1) # removes columns 'col1' and 'col2'
df.fillna(0) # fills missing values with 0
df.fillna(method='ffill') # fills missing values with previous
# non-missing value in the column
df.replace('old_val', 'new_val') # replaces 'old_val' with 'new_val'
df.groupby('col1').mean() # groups by 'col1' and computes
# the mean of each group
pd.merge(df1, df2, on='column1') # merges df1 and df2 on 'column1'
df['column1'].value_counts() # counts the number of occurrences
# of each unique value in 'column'
```
\normalsize
\vspace{3cm}
## Pandas - plotting data

Loading…
Cancel
Save