How to read TEXT file in Python Jupyter Notebook | Pandas
HTML-код
- Опубликовано: 24 янв 2025
- How to read TEXT file in Python Jupyter Notebook | Pandas
GitHub Jupyter Notebook: github.com/sid...
GitHub Data: github.com/sid...
About this video: In this video, you will learn How to read TEXT file in Python Jupyter Notebook
Large Language Model (LLM) - LangChain
LangChain: • LangChain Tutorial for...
Large Language Model (LLM) - LlamaIndex
LlamaIndex: • LlamaIndex Tutorial fo...
Machine Learning Model Deployment
ML Model Deployment: • ML Model Deployment us...
Spark with Python (PySpark)
PySpark: https: • PySpark with Python
Data Preprocessing (scikit-learn)
Data Preprocessing Python: • Data Preprocessing Python
Social Media Links
RUclips: / statswire
Twitter (X) : / statswire
#datascience #machinelearning #python #ai #ml #deeplearning #opencv #imageprocessing #ai #tensorflow #neuralnetworks #deeplearning #pandas
Thank you heaps. This tutorial was more helpful than what my professor taught. Thanks again
Thank you for your kind words.
Thank you so much for the wonderful tutorial. Clear, logical, and useful!
You're welcome!
Why didn't you use read_csv?
Also my text file is not properly arranged as in my data is not aligned under it's headers so do i need to adjust it?
You can also use read_csv function to read your text file. Yes, first arrange your text file properly or pass some parameters and see if you get a nice data frame in the output
@@StatsWire Thanks :)
@@sarthaknema1130 You're welcome
finally a helpful video!!
Thank you 🙂
youre a Hero
Thank you :-)
Thank you 🥺
You’re welcome 😊
In the txt file only contains columns but not present any row ? What should i do and how to tackle this situation?
What error are you getting?
@@StatsWire No error bro, data imports fine . Data contained only columns but not rows . So how to know either data is correct/ incorrect or may be csv file ?
@@akshaypatil6904 Does your CSV file has rows or not?
@@StatsWire no rows present 🥲 and client wants to run ml algorithm on it😢
@@akshaypatil6904 Haha, how is that possible? Without any data, we can't make any ML models.
sir where did you take this data from .....can you pls send its download link
Hi Avani, here is the data link
link: github.com/siddiquiamir/Data/blob/master/iris_tab.txt
Thanks a lott really helped me a lot!!
You're welcome Rakesh
Thank you for being helpful and positive
You're welcome
Bro iam getting pd is not defined?? Errors like name is not found are coming for me
No problem. First, you need to import pandas as pd so type
< import pandas as pd
If pandas is not installed then open your command prompt (cmd) and type
> pip install pandas
then type
> import pandas as pd
this will solve your problem
You are the best.😘
When i use read_table it didn't allign well.
I have to use read_csv then it gave me what i want
Thank you Emeka for finding it useful
Thank youuu!
You're welcome!
Does anyone know how to do with MacBook? All these tutorials are windows
Hello, please use below code to open a text file in macbook
import os
# Read in a plain text file
with open(os.path.join("c:user/xxx/xx", "xxx.txt"), "r") as f:
text = f.read()
print(text)
@@StatsWire sorry I can’t make sense of this
@@Vintagetube310 I don't have a MacBook otherwise I would have tested myself and sent it to you. Can you try this code, that "r" is important in the function
Automobile_data = pd.read_csv(r'Users/Spencer/Downloads/Automobile_data.csv')
Very nice tutorial
Thank you
But my error is coming
Can you please paste the error here so I can help you.
👍
Thank you