Skip to content

Tag: pandas

converting a key value text file into a CSV file

I have a text file that needs to be converted into CSV file using pandas. A piece of it is presented in the following: Rows are cod,10, and cod,18 and the columns are 1, 2, 3,…, 15. Any idea? Regards, Ali Answer I use pandas to deal with the conversion, but vanilla Python to deal with some of aspects of

create new column on conditions python

I have a ref table df_ref like this: I need to create a new column in another table based on ref table.The table like this: The output table df_org looks like: If any column value in col1 and col2 can find in ref table, it will use the ref col in ref table. If col1 and col2 are NULL, So

How to split words into different columns in dataframe?

I am new to coding , recently started learning to code. Currently I am stuck in the process to split a column. Please help me I have this dataframe and I want to split it into Really appreciate for taking your time and answering to my problem. PS: this is just an example of option symbol which is combination …