Skip to content

Tag: pandas

Numpy rounding issue

Can someone explain to me why is numpy round acting strange with this exact number rounding: It’s obvious that the first number is not rounded well, any ideas? EDIT: Since I’m focused here on the precision, not so much on the performance, I’ve used python round function to solve this problem…

How do I extract tables from word via table titles?

I’m facing the problem of trying to extract data from word files in the form of tables. I have to iterate through 500 word files and extract a specific table in each file, but the table appears at a different point in each word file. This is the code I have: Which goes through all the files fine, but ge…

Remove specific rows that contain dates Python

I have a dataset that has datetime values in it. I would like to remove all rows within a specific column that contain a certain year. All rows that contain 2027 should be removed. Data Desired Doing Any suggestion is appreciated. Error: AttributeError: Can only use .str accessor with string values! I believe…

Pandas won’t create CSV file?

just trying to save websockets to CSV’s. But it just doesnt make the file. Nothing in the directory. Tried running VScvode as admin, moving folder out of C: drive to documents .. nothing. no csv file, and no error. and no information on the internet about this either. So i kept stripping down the code t…

Downsampling time series data in pandas

I have timeseries data that looks like this: I would like to downsample my data from 15-minute frequencies to 1-hour frequencies. So, the first 4 rows above would be summed under 00:00 timestamp, then next 4 rows would be combined under 01:00. Is there an efficient way to make this happen? Answer Look at pand…