Comments (7)
Thanks for reporting this. I am indeed able to reproduce it with the latest version of nbstata v0.6.4 (and the Aug 30 update of Stata 18). I'll take a look now to see if there is a relatively quick fix.
from nbstata.
I don't understand the problem yet, but I have a workaround that seems to work: changing the missing
config value either in the configuration file or in a cell like:
%set missing = pandas
from nbstata.
Just verifying: this works with current v0.6.4, right?
from nbstata.
And is there a downside to using the pandas option?
from nbstata.
Yes, the workaround works with v0.6.4.
As far as a downside, I'm not aware of one. It doesn't make a visible difference in this example, and it may not ever do so. (This configuration option dates back to before I overhauled these magics to display numbers according to their Stata format, which may have made it redundant. It's that conversion to Stata format where the problem seems to lie--at this point, my best guess is that it worked with Pandas 1.4.2 but something changed by Pandas 2.1.0 that has made it not work.)
from nbstata.
Sure enough, another workaround is to add the noformat
option to the %head
magic. (In your example, this only removes the thousands comma from the display of "price" and "weight", but it may be a bigger deal in other cases, such as when using Stata's native date format.)
from nbstata.
Ok, I've traced it down to a change in pandas.api.types.is_string_dtype
. For Pandas 1.x, pd.api.types.is_string_dtype(pd.Series([1, "."]))(pd.Series([1, "."]))
returns True, but for Pandas 2.x, it returns False. I'm going to instead use not pandas.api.types.is_numeric_dtype
, which is more consistent across Pandas major versions. Hoping to ship a new version shortly.
from nbstata.
Related Issues (20)
- Kernel crashes with certain comments HOT 1
- Request: conda-forge package HOT 1
- invalid config options HOT 2
- `%help` triggers an unhandled error
- Ease setting figure dimensions in-line HOT 3
- New animated gif, specific to nbstata HOT 1
- XDG spec for config files HOT 7
- Tabs vs Spaces HOT 8
- Add config file location to %status magic output
- Add a Stata Quarto tutorial HOT 5
- Improve ability to initialize Stata automatically HOT 1
- Display config file errors in notebook HOT 7
- Config file saved at custom location (by `install --prefix`) ignored
- Add docs about using as alternative to 'stata_setup' package
- nbstata compiles document but does not work in interactive mode in quarto documents (in RStudio) HOT 5
- Broken link in documentation HOT 1
- Stata 18.5/Now support
- RStudio + Quarto Error HOT 3
- Can't find the stata installation path HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbstata.