Return a new frame with columns copy to the targeted device (cpu/gpu). Parameters ---------- device : Framework-specific device context object The context to move data to. kwargs : Key-word arguments. Key-word arguments fed to the framework co
(self, device, **kwargs)
| 942 | return subf |
| 943 | |
| 944 | def to(self, device, **kwargs): # pylint: disable=invalid-name |
| 945 | """Return a new frame with columns copy to the targeted device (cpu/gpu). |
| 946 | |
| 947 | Parameters |
| 948 | ---------- |
| 949 | device : Framework-specific device context object |
| 950 | The context to move data to. |
| 951 | kwargs : Key-word arguments. |
| 952 | Key-word arguments fed to the framework copy function. |
| 953 | |
| 954 | Returns |
| 955 | ------- |
| 956 | Frame |
| 957 | A new frame |
| 958 | """ |
| 959 | newframe = self.clone() |
| 960 | new_columns = { |
| 961 | key: col.to(device, **kwargs) |
| 962 | for key, col in newframe._columns.items() |
| 963 | } |
| 964 | newframe._columns = new_columns |
| 965 | return newframe |
| 966 | |
| 967 | def __repr__(self): |
| 968 | return repr(dict(self)) |