Compare commits
2 Commits
08b4b95cd5
...
6d866a38d3
Author | SHA1 | Date | |
---|---|---|---|
6d866a38d3 | |||
f5a433c43d |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -902,6 +902,33 @@ The basic indexable objects are
|
|||||||
```
|
```
|
||||||
\normalsize
|
\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
|
## Pandas - plotting data
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user