Skip to content

Commit 61e2419

Browse files
committed
update readme
1 parent b48256a commit 61e2419

1 file changed

Lines changed: 54 additions & 53 deletions

File tree

README.md

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,60 @@ easy and intuitive. It is heavily inspired by [Pandas](https://pandas.pydata.org
4747
- Robust data preprocessing functions like [OneHotEncoders](https://jsdata.gitbook.io/danfojs/api-reference/general-functions/danfo.onehotencoder), [LabelEncoders](https://jsdata.gitbook.io/danfojs/api-reference/general-functions/danfo.labelencoder), and scalers like [StandardSaler](https://jsdata.gitbook.io/danfojs/api-reference/general-functions/danfo.standardscaler) and [MinMaxScaler](https://jsdata.gitbook.io/danfojs/api-reference/general-functions/danfo.minmaxscaler) are supported on DataFrame and Series
4848

4949

50+
51+
To use danfo.js via script tags, copy and paste the CDN below to your HTML file
52+
53+
```html
54+
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.1.0/dist/index.min.js"></script>
55+
```
56+
57+
### Example Usage in the Browser
58+
59+
```html
60+
61+
<!DOCTYPE html>
62+
<html lang="en">
63+
<head>
64+
<meta charset="UTF-8">
65+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66+
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.1.0/dist/index.min.js"></script>
67+
<title>Document</title>
68+
</head>
69+
70+
<body>
71+
72+
<div id="div1"></div>
73+
<div id="div2"></div>
74+
<div id="div3"></div>
75+
76+
<script>
77+
78+
dfd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv")
79+
.then(df => {
80+
81+
df['AAPL.Open'].plot("div1").box() //makes a box plot
82+
83+
df.plot("div2").table() //display csv as table
84+
85+
new_df = df.set_index({ key: "Date" }) //resets the index to Date column
86+
new_df.plot("div3").line({ columns: ["AAPL.Open", "AAPL.High"] }) //makes a timeseries plot
87+
88+
}).catch(err => {
89+
console.log(err);
90+
})
91+
92+
</script>
93+
94+
</body>
95+
96+
</html>
97+
```
98+
99+
Output in Browser:
100+
101+
![](assets/browser-out.gif)
102+
103+
50104
## How to install
51105
danfo.js is hosted on NPM, and can installed via package managers like npm and yarn
52106

@@ -120,59 +174,6 @@ Output in Node Console:
120174
![](assets/node-rec.gif)
121175

122176

123-
To use danfo.js via script tags, copy and paste the CDN below to your HTML file
124-
125-
```html
126-
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.0.15/dist/index.min.js"></script>
127-
```
128-
129-
### Example Usage in the Browser
130-
131-
```html
132-
133-
<!DOCTYPE html>
134-
<html lang="en">
135-
<head>
136-
<meta charset="UTF-8">
137-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
138-
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.0.15/dist/index.min.js"></script>
139-
<title>Document</title>
140-
</head>
141-
142-
<body>
143-
144-
<div id="div1"></div>
145-
<div id="div2"></div>
146-
<div id="div3"></div>
147-
148-
<script>
149-
150-
dfd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv")
151-
.then(df => {
152-
153-
df['AAPL.Open'].plot("div1").box() //makes a box plot
154-
155-
df.plot("div2").table() //display csv as table
156-
157-
new_df = df.set_index({ key: "Date" }) //resets the index to Date column
158-
new_df.plot("div3").line({ columns: ["AAPL.Open", "AAPL.High"] }) //makes a timeseries plot
159-
160-
}).catch(err => {
161-
console.log(err);
162-
})
163-
164-
</script>
165-
166-
</body>
167-
168-
</html>
169-
```
170-
171-
Output in Browser:
172-
173-
![](assets/browser-out.gif)
174-
175-
176177
#### [See the Official Getting Started Guide](https://jsdata.gitbook.io/danfojs/getting-started)
177178

178179
## Documentation

0 commit comments

Comments
 (0)