Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C cdm-mapper
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • iregon
  • cdm-mapper
  • Issues
  • #3

Closed
Open
Created Mar 30, 2020 by iregon@iregonMaintainer

Erros when dataframe has only one row

At least one method has shown to fail when the nullable integers were introduced and the number of rows in the dataframe is 1.

Namelly, function string_add in the icoads_3000.py submodule, was failing in line: df.iloc[:,col] = df.iloc[:,col].astype(str).str.zfill(width)

when the col initial datatype was 'UInt8' (months), being the output column format 'object' and the number of rows was 1. The erros was:

TypeError: object cannot be converted to an IntegerDtype

This error was isolated and reproduced with test dfs.

So far, the solution is to duplicate the df in the function if nrows ==1 and then only return 1 line....

Edited Mar 30, 2020 by iregon
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking