Creating a Series
Parameters
Type
Description
Creating a Series from an object:
const dfd = require("danfojs-node")
obj_data = { 'B': ["bval1", "bval2", "bval3", "bval4"] }
df = new dfd.Series(obj_data)
df.print()<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--danfojs CDN -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/bundle.min.js"></script> <title>Document</title>
</head>
<body>
<script>
json_data = [{ A: 0.4612, B: 4.28283, C: -1.509, D: -1.1352 },
{ A: 0.5112, B: -0.22863, C: -3.39059, D: 1.1632 },
{ A: 0.6911, B: -0.82863, C: -1.5059, D: 2.1352 },
{ A: 0.4692, B: -1.28863, C: 4.5059, D: 4.1632 }]
df = new dfd.DataFrame(json_data)
df.print()
</script>
</body>
</html>╔═══╤═══════╗
║ 0 │ bval1 ║
╟───┼───────╢
║ 1 │ bval2 ║
╟───┼───────╢
║ 2 │ bval3 ║
╟───┼───────╢
║ 3 │ bval4 ║
╚═══╧═══════╝Creating a Series from an array
Creating a Series and specifying index and dtypes
Creating a Series and specifying memory mode
Last updated