Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python dynamic csvnfile joining

import os
import pandas as pd

df = pd.concat(
    [pd.read_csv(f, sep="	") for f in os.listdir() if f.endswith(".csv") and f.startswith("sample")], 
    ignore_index=True
)

df = df.pivot_table(index="ProbeID", columns="p_code", values="intensities", aggfunc="sum")
print(df)
Comment

PREVIOUS NEXT
Code Example
Python :: for_else_and_while_else_statement 
Python :: how to catch chunkedencodingerror 
Python :: accumulate sum of elements in list 
Python :: bson to dataframe pandas 
Python :: how to simulate a keypress using pyautogui 
Python :: calculated fields in models 
Python :: schema json in oython 
Python :: Jupyter to access jupyter notebook on virtualbox guest through browser in windows host 
Python :: windows use py instead of python 
Python :: pandas from multiindex to single index 
Python :: sliding window maximum 
Python :: how call a class in another class python 
Python :: program to add two numbers in python 
Python :: unittest run one test 
Python :: how parse date python no specific format 
Python :: Code Example of Checking if a variable is None using is operator 
Python :: accessing multiple elements from the list 
Python :: cubic interpolation python 
Python :: for loop for many integers in list 
Python :: how to stop a function from returning none 
Python :: get parent keys of keys python 
Python :: how to dinamically create the Q query in django 
Python :: Python NumPy transpose Function Example with use of tuples 
Python :: pypi autopep8 
Python :: Python NumPy require Function Syntax 
Python :: TemplateDoesNotExist at / 
Python :: python __truediv__ 
Python :: setstylesheet python 
Python :: NumPy unpackbits Code Unpacked array along axis 0 
Python :: turn dictionary into flat list 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =