danfo.DataFrame.dtypes [source]
Returns:
return Series
Returns auto-generated index of a DataFrame
const dfd = require("danfojs-node")let data = {"A": [-20.1, 30, 47.3, -20],"B": [34, -4, 5, 6],"C": [20, -20, 30, -40]}let df = new dfd.DataFrame(data)df.ctypes.print()
╔═══╤══════════════════════╗║ │ 0 ║╟───┼──────────────────────╢║ A │ float32 ║╟───┼──────────────────────╢║ B │ int32 ║╟───┼──────────────────────╢║ C │ int32 ║╚═══╧══════════════════════╝
Columns with mixed types are represented as string.
const dfd = require("danfojs-node")let data = {"A": [-20.1, 30, 47.3, -20],"B": [34, -4, 5, 6],"C": [20, -20, 30, -40],"D": ["a", "b", 20, 2.5]}let df = new dfd.DataFrame(data)df.ctypes.print()
╔═══╤══════════════════════╗║ │ 0 ║╟───┼──────────────────────╢║ A │ float32 ║╟───┼──────────────────────╢║ B │ int32 ║╟───┼──────────────────────╢║ C │ int32 ║╟───┼──────────────────────╢║ D │ string ║╚═══╧══════════════════════╝
Note: To cast a type, use the astype method.