You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/migrating-to-the-stable-version-of-danfo.js.md
+9-32
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,11 @@ We recently released the first stable version of Danfo.js. See release note here
10
10
11
11
The following list summarizes some of these updates:
12
12
13
-
***Typescript support:** This new version has been completely re-written using Typescript. This means we now have well-defined types that increases the developer experience. 
14
-
***Standard naming convention:** Functions, methods, classes, and variable names have been standardized to follow JavaScript best practices. 
15
-
* Standardize function argument: Functions and methods have been updated to accept arguments and parameters intuitively resulting in improved developer experience. 
13
+
***Typescript support:** This new version has been completely re-written using Typescript. This means we now have well-defined types that increase the developer experience.
14
+
***Standard naming convention:** Functions, methods, classes, and variable names have been standardized to follow JavaScript best practices.
15
+
* Standardize function argument: Functions and methods have been updated to accept arguments and parameters intuitively resulting in improved developer experience.
16
16
***New features**: We added lots of new features which users have been requesting for. For example:
17
17
* Stream and process large CSV data
18
-
* Read JSON objects with key support
19
-
* Date time is now a first-class data type.
20
18
* General bug fixes and improvements
21
19
* Better error messages
22
20
@@ -34,15 +32,15 @@ to_json ==> toCSV
34
32
drop_duplicates ==> dropDuplicates
35
33
```
36
34
37
-
**Note:** that your code editor auto-complete will general suggest the new function or method names, so it will be easier to update to the new names. If using Typescript, then it is even easier as the TS compiler will show you warnings. 
35
+
**Note:** that your code editor auto-complete will general suggest the new function or method names, so it will be easier to update to the new names. If using Typescript, then it is even easier as the TS compiler will show you warnings.
38
36
39
37
### Functions and Methods argument structure
40
38
41
39
Another major breaking change of v1, is that the structure of arguments/parameters in most functions has been updated to be more intuitive.
42
40
43
41
In general, it is important to understand our thought process behind this, so, here goes:
44
42
45
-
Assuming we take the method called _**rename**_, which takes required object mapper, as well as, optional configuration argument. In pre-v1 version of Danfojs, the function signature is as follows:
43
+
Assuming we take the method called _**rename**_, which takes required object mapper, as well as, optional configuration argument. In pre-v1 version of Danfojs, the function signature is as follows:
46
44
47
45
```
48
46
rename( { mapper, axis, inplace } ) => DataFrame
@@ -54,39 +52,18 @@ The structure above combines both required and optional arguments as a single ob
54
52
rename(mapper, options: {axis, inplace}) //where mapper is required, and options argument is optional.
55
53
```
56
54
57
-
Re-designing functions and methods to follow this intuitive format is the bulk of the breaking change in this new version, as such, when migrating, you have to make these updates. 
55
+
Re-designing functions and methods to follow this intuitive format is the bulk of the breaking change in this new version, as such, when migrating, you have to make these updates.
58
56
59
57
{% hint style="info" %}
60
-
If using Typescript, then the TS compiler will help in migration, else, you have to manually identify and update your function/method signature. 
58
+
If using Typescript, then the TS compiler will help in migration, else, you have to manually identify and update your function/method signature.
61
59
{% endhint %}
62
60
63
61
### Axis Order
64
62
65
63
In this new version, we have flipped the result of the axis ordering for all operations. This ordering is now consistent with Pandas and Tensorflow.js. That is, the axis row (0), represents the operations carried out horizontally on a DataFrame, and the axis columns (1) represent operations carried out vertically down the DataFrame.
66
64
67
65
{% hint style="info" %}
68
-
In short, when migrating to the new version, you should flip the axis number so as to get the same result. That is, change all `axis: 0` to `axis: 1`, to get the same result. 
66
+
In short, when migrating to the new version, you should flip the axis number so as to get the same result. That is, change all `axis: 0` to `axis: 1`, to get the same result.
69
67
{% endhint %}
70
68
71
-
All examples in this doc have been updated to reflect this update. 
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
69
+
All examples in this doc have been updated to reflect this update.
0 commit comments