Category "pandas"

SQL query returns result multiple times

I'm pretty new to SQL and am trying to join some tables in SQL. I'm using SQLite3 and Pandas and have the following table structure: User | Measuremen

SQL query returns result multiple times

I'm pretty new to SQL and am trying to join some tables in SQL. I'm using SQLite3 and Pandas and have the following table structure: User | Measuremen

FileNotFoundError when reading .h5 file from S3 in python using Pandas

For some reason, when I attempt to read a hdf file from S3 using the pandas.read_hdf() method, I get a FileNotFoundError when I put an s3 url. The file definite

Find specific value knowing row pandas

I have a dataframe with this structure: A indexer attr1_rank attr2_rank attr3_rank attr4_rank ... attrn_rank P 1 2 1 3 4 ... n S 2 1 2 4 3 ... n How can i add

FInding fft gives keyerror :'Aligned ' pandas

I have a time series data I am trying to find the fft .But it gives keyerror :Aligned when trying to get the value my data looks like below this is the code: i

FInding fft gives keyerror :'Aligned ' pandas

I have a time series data I am trying to find the fft .But it gives keyerror :Aligned when trying to get the value my data looks like below this is the code: i

how to merge multiple datasets with differences in merge-index strings?

Hello I am struggling to find a solution to probably a very common problem. I want to merge two csv-files with soccer data. They basically store different data

How to solve (NaN error) when given column specific name

I have many text files include data as follow: 350.0 2.1021 0.0000 1.4769 0.0000 357.0 2.0970 0.0000 1.4758 0.0000 364.0 2.0920 0.0000

How to solve (NaN error) when given column specific name

I have many text files include data as follow: 350.0 2.1021 0.0000 1.4769 0.0000 357.0 2.0970 0.0000 1.4758 0.0000 364.0 2.0920 0.0000

How to select multiple columns by name that are not adjacent and combining several slicing methods?

Is there a way to select multiple columns that are not adjacent and combining several methods? test dataframe: test = pd.DataFrame(np.random.rand(3, 9),

Pandas- DataError: No numeric types to aggregate

I have a DataFrame with 5 columns, where the column i need to aggregate is of a string, and has NaN values. I tried replacing the nan values with 0 and then con

Fastest way to iterate subsets of rows in pandas dataframe based on condition

I have a dataframe with a column of IDs and a column of values - each ID is associated with two or more rows. When any subset of values within a given ID meets

Python Pandas read_sql rounds and converts numbers

I'm executing a query on IBM DB2 server with ibm_db_dbi. Here is my query: connection = ibm_db_dbi.connect(hostSettings, '', '') ret = pd.read_sql(query, connec

Rearrange pandas Dataframes

I decide to simplify my post and replace images with code which has the same structure (and problem) inside and everyone could 'copy-paste' this example to try

How to slice multiple sections of dataframe by column name?

How do I get the first column, then add another slice? For example: import pandas as pd df = pd.DataFrame(pd.np.random.rand(6,6), columns = list('abcdef'))

How to read csv from ftp using pandas? [duplicate]

I connected to a sftp and got a list of files successfully: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy( paramiko.AutoAddPolicy

If value is greater than the previous replace with previous in Pandas

I am working on a data processing script that does some basic calcs from data files and sorts the data. The last piece to the puzzle is identifying if the next

How to replace column values with dictionary keys

I have a df, A B one six two seven three level five one and a dictionary my_dict={1:"one,two",2:"three,four"} I want to replace df.A with my_di

df.to_csv function prints out the content instead of writing data to a file

df.to_csv(output_file) is supposed to write the content of a DataFrame to a file. While the function is working for 99.9% of the file in my directory, there is

TENSORFLOW: UNSUPPORTABLE CALLABLE

I am trying to build the following model but am getting this error when I am finally training the model and trying to get it's accuracy. It gets stuck when I am