Giter Site home page Giter Site logo

Comments (9)

martinRenou avatar martinRenou commented on June 18, 2024 1

I do not like side-effect programming like that too, but we gotta admit that it is pretty useful.

Anyway, I don't really get what you mean by "So perhaps I should switch back to strings if I want to allow empty cells". Cells will be empty if values are None, if that's what you are looking for:

s = ipysheet.sheet(rows=1, columns=4)
row = ipysheet.row(0, [0, None, 2, 3])
s

and this is the output:
row
This example is using the easy API but you can replicate the same behavior with Cell, using numeric type.

from ipysheet.

martinRenou avatar martinRenou commented on June 18, 2024

Mmh, just one thing first, why are you creating your cell like that:

Cell(value='', ..., type='numeric')

?
You're passing a string value but you expect type to be numeric, it's kind of weird no?
Maybe you would prefer to use the easy API:

from ipysheet import sheet, cell # Without the capital letters

s = sheet()
cell(0, 0, value=4.)
s

from ipysheet.

martinRenou avatar martinRenou commented on June 18, 2024

Thinking about it, I think your Cell(value='', ..., type='numeric') should throw an error Python side

from ipysheet.

krey avatar krey commented on June 18, 2024

Thinking about it, I think your Cell(value='', ..., type='numeric') should throw an error Python side

So perhaps I should switch back to strings if I want to allow empty cells

from ipysheet.

krey avatar krey commented on June 18, 2024

Mmh, just one thing first, why are you creating your cell like that:

Cell(value='', ..., type='numeric')

?
You're passing a string value but you expect type to be numeric, it's kind of weird no?
Maybe you would prefer to use the easy API:

from ipysheet import sheet, cell # Without the capital letters

s = sheet()
cell(0, 0, value=4.)
s

Thanks Martin.

I'm familiar with the "easy" API, but I'm opposed to its matplotlib style "everything is a side-effect" philosophy.

from ipysheet.

martinRenou avatar martinRenou commented on June 18, 2024

Closing this one, feel free to open again if needed

from ipysheet.

krey avatar krey commented on June 18, 2024

@martinRenou Why close it?

The original issue (period terminated integer) still persists in 5065a59

from ipysheet.

martinRenou avatar martinRenou commented on June 18, 2024

I closed it because it was an issue in your code, no? You were creating a 'numeric' cell given a string value.

I guess the link you just gave is wrong? It is not related to this issue

from ipysheet.

martinRenou avatar martinRenou commented on June 18, 2024

Oh sorry, I get it.

Yeah, the issue you are talking about still stands. I guess this issue you already opened is clearer. We need to have an 'int' and a 'float' cell type. This could fix your issue.

from ipysheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.