how to convert a .csv file to .bag in python? - python

I have some VLP16 LiDar data in .csv file format, have to load the data in Ros Rviz for which I need the Rosbag file(.bag). I have tried finding it in the Ros tutorial, what I got was to convert .bag to .csv

I'm not actually expert in processing .bag files but I think you need to go through your CSV file and manually add the values using rosbag Python API

Not direct answer but check this script in python, which might help you.
Regarding C++ I propose this repository: convert_csv_to_rosbag which is even closer to what you asked.
However, it seems that you need to do it by yourself based on these examples.

Related

read numpy compressed file using matlab [duplicate]

I was wondering if there is way to read .npy files in Matlab? I know I can convert those to Matlab-style .mat files using scipy.io.savemat in Python; however I'm more interested in a native or plugin support for .npy files in Matlab.
This did the job for me, I used it to read npy files.
https://github.com/kwikteam/npy-matlab
If you only want to read .npy file all you need from the npy-matlab project are two files: readNPY.m and readNPYheader.m.
Usage is as simple as:
>> im = readNPY('/path/to/file.npy');
There is a c++ library available https://github.com/rogersce/cnpy
You could write a mex function to read the data. I would prefer to store everything in hdf5
A quick way would be to read it in python, as below,
data = np.load('/tmp/123.npz')
Then save it as '.csv', again by python, using python documentation or,
numpy.savetxt('FileName.csv', arrayToSave)
(more documentation here)
Finally, you can read it in MATLAB using the following command,
csvread()
Quick Update:
As the user "Ender" mentioned in the comments, the csvread() is now deprecated and readmatrix() stands in its lieu. (documentation)

Use Pandas(Python) to read really big csv files from Google Drive

Good afternoon!
While using pandas to read csv data files > 500MB from my drive, instead of getting the csv file I receive the "can't scan large file for viruses" HTML page. I've tried a lot but can't find any workarounds. Can anyone tell me if it's possible to bypass that?
Sample file:- https://drive.google.com/file/d/1EQbD11iRnbXVJMZNTVExfrRP5WYIcAjk/view
Error Image
PS can someone also suggest a better (preferably free) service to upload multiple big csv files so that I can use pandas to get the data from it... i have >40gb of data to work with
Thanks :)
I found this and it's working for me as of 14/10/2020 though it was taken off of the documentation: http://web.archive.org/web/20190621105530/https://developers.google.com/drive/api/v3/manage-downloads

How to parse a binary file in python

I am still new to the python when it comes to parsing data. I'd like solve this problem that can be seen in the image and the respective "telemetry.bin" and 'TLM_LIST.csv" are in the google drive folder. I am able to operate the csv file using pandas but don't how to deal with the bin file as it throws output like below:
https://drive.google.com/open?id=1h_15khW2abjT8V6L38VSrqpb5vrmDfa-
b'\n\x00\x00\x07\x08\x01\x0b\xe7\x08\xc3\x0b\xd9\x07\x9e\x04\xe4\x00\x00\x0c\xef\x00\x99\x1f\xdb\x00\x00\x00\x00\xbe\xef\xca\xfe\x00\x00\x01\x00\x02\x04\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00mg2878_a A\x00\xc1\x00\x8fe\xb8>\x00\x00\x00\x05\x00%~\x1a\x00\x00\x00\x96\x00\x00\x00\x91\x00\x01\x02\x00\x00\x00\x00\x8fe\xb8?\x00\x00\x00\x00'
enter image description here
Please I really wanna learn so please help.
Thanks in advance.

How to read in tableau (twbx) file into python?

I would like to produce some custom output with python with data from Tableau files. I dont have access to the Tableau server to run the 'Tabpy' library.
Is there any other way to do it?
Thank you in advance
You may find the following link useful.
https://community.tableau.com/thread/152463
One of the posts in the thread mentioned the following which is worth exploring:
If you're looking to generate a TWBX dynamically, you should rename
your .twbx file to .zip, extract the contents and you can do whatever
you want with those in Python to dynamically create or adjust a
workbook file. The structure / definition of the workbook file is just
XML so no special code needed to read and parse that.

Saving files openoffice Python

I'm working on a script to create an OpenOffice document. After this i want to save the file. Maybe later also as an PDF.. Google doesn't give me any information how to fix this..
My question here is: What method should be used to save an openoffice-writer document?
Thanks in advance!
You should look at this similar question which answer covers both MSWord and OOWriter (by the way, creating a Word file could be the easiest to be read with OpenOffice).
How can I create a Word document using Python?
Alexis
You can create a rtf file with pyrtf or it's variants, and for pdf you can use reportlab. These are libraries for use in python, not to control remotely oo. There are other libraries for other formats.

Categories

Resources