Skip to content

Commit dedd65e

Browse files
author
zoupeicheng
committed
updated
1 parent 8e4119c commit dedd65e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

DataProcessing.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ Suppose f is a csv file with tab as delimiters, then we do this:
2121
df = pd.read_csv(f,delimiter ='\t')
2222
```
2323

24+
Note that sometimes data may be messy, explore options of read_csv.
25+
For example, some files may have extra spaces at the beginning of the fields, you need
26+
```python
27+
df = pd.read_csv(f,delimiter=' ',skipinitalspace=True)
28+
```
29+
You can also use 'usecols' to specify the columns you want.
30+
31+
2432
##### json files
2533

2634
json files are human readable, you can think of them as python dictionaries. We want to load them into pandas DataFrame.

0 commit comments

Comments
 (0)