'I got many dtypes errors
Here is my dataframe:
*Ca *O *Ca Ca Hy
0 1 2 3 4 5
1 1
2 1 5
3 1 6 7 8
4 5
5 6
6 6
7 6
8 9
9 9 12
10 9 9 10 11
and when I tried to contact it like this:
pd.concat([df] + [df+i for i in range(10, 250, 10)], ignore_index=True) I get errors like np.int is not iterable and can not concate str to int
Also my dataframe contains NAN , and I use df.fillna('', inplace=True) to replace NAN with nothing '' which it seems problem to convert to an int
Solution 1:[1]
Try using df.fillna(0,inplace=True),
It should give out desired output, asreplacing the NaN value would not affect you sum.
Also my dataframe contains NAN , and I use
df.fillna('', inplace=True)to replace NAN with nothing''which it seems problem to convert to an int
As the data type of '' is string (it is an empty string not nothing)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | micro5 |
