I am complete novice in coding 6 weeks in… I am working on large data set 18 columns with 1,282,354 entries for my assignment and I’m stuck on this issue:
The dataset has two location columns “State” and “ZIP Code” see below sample.
State ZIPCode
0 CA 4568
1 NaN NaN
2 FL 4546XX
3 TX 323
4 NY 45578
5 NaN 7857x
6 GA 7888AC
7 AA NaN
I have some missing values and wanted to replace them based on the value of one of the columns for example:
If State is not NaN but ZIP Code is NaN, then fill ZIP Code NaN with “N/A”
and
If State is NaN and ZIP Code is NaN, then fill both State and ZIP Code with “Unknown”
and also
If State is NaN but ZIP Code is not NaN, then fill State with “No Data” (I don’t think I have any gaps here but can’t be sure)