This repository contains Jupyter Notebook tutorials demonstrating various techniques and parameters for working with CSV files using the Pandas library in Python.
-
Basic CSV Operations
- Importing pandas
- Reading local CSV files
- Reading CSV files from URLs
-
CSV Reading Parameters
sepparameter - Specifying different delimitersindex_colparameter - Setting specific columns as indexheaderparameter - Handling column headersusecolsparameter - Selecting specific columns to readsqueezeparameterskiprows/nrowsparameters - Controlling row readingencodingparameter - Handling different file encodingserror_bad_linesparameter - Handling parsing errorsdtypeparameter - Specifying column data typesparse_datesparameter - Handling date columnsconvertersparameter - Transforming data during importna_valuesparameter - Specifying custom NA/NaN values- Working with large datasets using
chunksize
1st.ipynb: Main Jupyter notebook containing all examples and explanationsaug_train.csv: Sample dataset used for demonstrationsPsl_Complete_Dataset(2016-2024).csv: PSL (Pakistan Super League) dataset used for specific examples
To run these examples:
- Make sure you have Python installed on your system
- Install required libraries:
pip install pandas - Open the Jupyter notebook
1st.ipynbto see the examples and run them interactively
- Reading CSV files with different parameters
- Handling different types of data
- Working with large datasets efficiently
- Data transformation during import
- Error handling and data cleaning
- Custom data conversions
Clone this repository and open the Jupyter notebook to start learning about different ways to work with CSV files using Pandas:
git clone https://github.com/mkhalidh/ML_Working-with-CSV-files.git
cd ML_Working-with-CSV-files
jupyter notebook- Python 3.x
- Pandas library
- Jupyter Notebook
- Khalid
These notes are based on a comprehensive tutorial about working with CSV files using Pandas. The examples demonstrate practical use cases and common scenarios when dealing with CSV data in Python.
Feel free to contribute to this repository by creating pull requests or reporting issues!