Skip to content

Commit 5692deb

Browse files
20240414 - import data using pandas
1 parent 66c300b commit 5692deb

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

_quarto.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ website:
77
left:
88
- href: index.qmd
99
text: Home
10+
- text: Python Guides
11+
menu:
12+
- text: Data Management
13+
href: dataManagement.qmd
1014
- text: Links
1115
menu:
1216
- text: Lab Wiki

dataManagement.qmd

+19-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ format:
1515

1616
# Import Data {#importData}
1717

18-
Importing data takes syntax of the following form for `.csv` files:
18+
Importing data using `pandas` takes syntax of the following form for `.csv` files:
1919

2020
```{python}
2121
#| eval: false
@@ -24,3 +24,21 @@ import pandas as pd
2424
2525
data = pd.read_csv("filepath/filename.csv")
2626
```
27+
28+
Below, I import a `.csv` file and save it into an object called `mydata` (you could call this object whatever you want):
29+
30+
```{python}
31+
#| eval: false
32+
33+
import pandas as pd
34+
35+
data = pd.read_csv("https://osf.io/s6wrm/download")
36+
```
37+
38+
```{python}
39+
#| include: false
40+
41+
import pandas as pd
42+
43+
data = pd.read_csv("data/titanic.csv") #https://osf.io/s6wrm/download
44+
```

index.qmd

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
title: "Website"
33
---
44

5-
This is a Quarto website.
6-
7-
To learn more about Quarto websites visit <https://quarto.org/docs/websites>.
5+
- [Data Management](dataManagement.html)

0 commit comments

Comments
 (0)