Giter Site home page Giter Site logo

Comments (1)

stinodego avatar stinodego commented on July 19, 2024

This is a conscious design choice. See the linked PR for discussion. Ritchie's response:

I am not sure here. Why not Object type then? We have one.

I am also not sure because often pandas strings are objects. Pandas is ambiguous. We cannot fix that so we have to be a little more lenient here. You will now fix #14601 and for that fix, tons of other issues will open about strings not being correctly read.

To avoid the issue in the original description, explicitly specify a schema if you are working with non-string object columns that could be empty, e.g.:

import polars as pl
import pandas as pd

pd_df = pd.DataFrame({"A": [None]})
df = pl.from_pandas(pd_df, schema_overrides={"A": pl.Time})
print(df)
shape: (1, 1)
┌──────┐
│ A    │
│ ---  │
│ time │
╞══════╡
│ null │
└──────┘

from polars.

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.