Skip to content

Instantly share code, notes, and snippets.

View techykajal's full-sized avatar
🎯
Focusing

kajal yadav techykajal

🎯
Focusing
View GitHub Profile
# Code for accented characters removal
def accented_characters_removal(text):
# this is a docstring
"""
The function will remove accented characters from the
text contained within the Dataset.
arguments:
input_text: "text" of type "String".
def remove_whitespace(text):
""" This function will remove
extra whitespaces from the text
arguments:
input_text: "text" of type "String".
return:
value: "text" after extra whitespaces removed .
Example:
def strip_html_tags(text):
"""
This function will remove all the occurrences of html tags from the text.
arguments:
input_text: "text" of type "String".
return:
value: "text" after removal of html tags.
def remove_newlines_tabs(text):
"""
This function will remove all the occurrences of newlines, tabs, and combinations like: \\n, \\.
arguments:
input_text: "text" of type "String".
return:
value: "text" after removal of newlines, tabs, \\n, \\ characters.
#Command line script for youtube to gif maker
git clone https://github.com/techykajal/youtube-to-gif-maker.git
cd downloads/youtube-to-gif
youtube-dl -o input.mkv https://www.youtube.com/watch?v=AzjS8k5TEsY
ffmpeg -i input.mkv -ss 76 -t 4 output.mp4
ffmpeg -i output.mp4 -vf drawtext="fontfile=/path/to/font.ttf: \
import pandas as pd
import matplotlib.pyplot as plt
Df = pd.read_csv("/content/Market.csv", encoding = 'latin')
Df.head()
#Location wise Data Science Jobs
Df.Location.apply(pd.Series).stack().str.strip().value_counts()[:10].plot.pie(figsize=(12,10),startangle=50,autopct='%1.1f%%',fontsize=15)
plt.title("Location Wise Data scientist Jobs",fontsize=30)
centre_circle = plt.Circle((0,0),0.72,color='gray', fc='white',linewidth=1.25)
pip install --upgrade ShopifyAPI
import shopify
import pandas as pd
df = pd.read_csv('THIS_IS_FINAL.csv', encoding = 'latin-1')
df.head()
shop_url = "https://1da77cd6765932aa:sh2ad37dd07bb32aa@techy-kajal.myshopify.com/admin/api/2020-07"
shopify.ShopifyResource.set_site(shop_url)
# Get the current shop
replies=[]
for tweet in tweepy.Cursor(api.search,q='to:'+name, result_type='recent', timeout=999999).items(100):
if hasattr(tweet, 'in_reply_to_status_id_str'):
if (tweet.in_reply_to_status_id_str==tweet_id):
replies.append(tweet)
with open('trump_data.csv', 'a+') as f:
csv_writer = csv.DictWriter(f, fieldnames=('user', 'text'))
csv_writer.writeheader()
for tweet in replies:
labels = ['Positive_Trump', 'Positive_Biden']
sizes = lis_pos
explode = (0.1, 0.1)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels = labels, autopct = '%1.1f%%', shadow = True, startangle=90)
ax1.set_title('Positive tweets on both the handles')
plt.show()