Strings not read correctly?
See original GitHub issueOn my Linux system since recently I have to do the following to use a list of strings:
files = [file.decode('UTF-8') for file in data['/files'][...]]]
This is my system:
h5py 3.1.0
HDF5 1.10.6
Python 3.8.6 | packaged by conda-forge | (default, Nov 27 2020, 19:31:52)
[GCC 9.3.0]
sys.platform linux
sys.maxsize 9223372036854775807
numpy 1.19.4
cython (built with) 0.29.21
numpy (built against) 1.16.5
HDF5 (built against) 1.10.6
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Not reading a string properly - c++ - Stack Overflow
An easy way to do this in C++ is to put the line into an istringstream then loop while (iss > myint). If...
Read more >Input String Was Not in a Correct Format: Easy Fixes
Input string was not in a correct format warning mainly occurs when you try to convert a non-numeric string into an int. Read...
Read more >Python Strings | Python Education - Google Developers
Python has a built-in string class named "str" with many handy features (there is an older module named "string" which you should not...
Read more >String vector inside structure not read in Matlab R2014b
I have a problem with a .mat file generated with Matlab 2018. Besides other variables, it contains a structure with a string vector...
Read more >File.ReadAllText Method (System.IO) - Microsoft Learn
Opens a text file, reads all the text in the file into a string, and then closes the file. ... because unrecognized characters...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The string interfaces changed in 3.0 (release notes). You can use
data['/files'].asstr()[...]
to read them as str objects - this is essentially a convenient shortcut for the list comprehension you’ve written.Thanks @aragilar ! Let’s close then.