Fix typos in course.
parent
eb71226f30
commit
1fda03516f
|
@ -97,6 +97,7 @@ b = pd.Series(["I","like","to","play","games","and","will","not","change"],index
|
||||||
df = pd.DataFrame([a,b])
|
df = pd.DataFrame([a,b])
|
||||||
```
|
```
|
||||||
This will create a horizontal table like this:
|
This will create a horizontal table like this:
|
||||||
|
|
||||||
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||||
| --- | --- | ---- | --- | --- | ------ | --- | ------ | ---- | ---- |
|
| --- | --- | ---- | --- | --- | ------ | --- | ------ | ---- | ---- |
|
||||||
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|
||||||
|
@ -122,7 +123,7 @@ This will give us a table like this:
|
||||||
|
|
||||||
**Note** that we can also get this table layout by transposing the previous table, eg. by writing
|
**Note** that we can also get this table layout by transposing the previous table, eg. by writing
|
||||||
```python
|
```python
|
||||||
df = pd.DataFrame([a,b]).T..rename(columns={ 0 : 'A', 1 : 'B' })
|
df = pd.DataFrame([a,b]).T.rename(columns={ 0 : 'A', 1 : 'B' })
|
||||||
```
|
```
|
||||||
Here `.T` means the operation of transposing the DataFrame, i.e. changing rows and columns, and `rename` operation allows us to rename columns to match the previous example.
|
Here `.T` means the operation of transposing the DataFrame, i.e. changing rows and columns, and `rename` operation allows us to rename columns to match the previous example.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue