-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (26 loc) · 852 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<title>Read CSV with Pandas using PyScript</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<!---pyodide-->
<py-env>
- matplotlib
- pandas
- seaborn
</py-env>
</head>
<body>
<h1>Read CSV with Pandas using PyScript</h1>
<p id="csv"></p>
<py-script>
import pandas as pd
from pyodide.http import open_url
url_content = open_url("https://gist.githubusercontent.com/netj/8836201/raw/6f9306ad21398ea43cba4f7d537619d0e07d5ae3/iris.csv")
df = pd.read_csv(url_content)
csv = Element('csv')
csv.write(df.head(10))
</py-script>
</body>
</html>