This short Python tutorial shows how to simply create a new DataFrame column only containing all numeric (non-NaN) values from other DataFrames in Python with the stack() function. All the DataFrames contain numerical values at the same place in the data table. For each DataFrame we create one column in a new DataFrame. The stack() function creates DataFrames with multiple indexes and uses a default to remove NaN values.
- Күн бұрын
Create a new df column only with all non-NaN values from other df in Python with df.stack()
- Рет қаралды 416
Пікірлер