{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":538999689,"defaultBranch":"master","name":"LeetCode-Questions-CompanyWise","ownerLogin":"aryan-bhokare","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2022-09-20T13:20:41.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/92683836?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1663680042.665537","currentOid":""},"activityList":{"items":[{"before":"209b7300b8918dbed25de924c553943a639b4f22","after":"fb5f78b55eead7f948aada8459c5bfd31ae8abbc","ref":"refs/heads/master","pushedAt":"2023-04-03T20:01:39.103Z","pushType":"push","commitsCount":3,"pusher":{"login":"aryan-bhokare","name":"Aryan Bhokare","path":"/aryan-bhokare","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/92683836?s=80&v=4"},"commit":{"message":"Chore: Add headers to all the files (#54)\n\n## Description\r\n- Add headers to all the CSV files\r\n\r\n## Script used\r\n```py\r\nimport csv\r\nimport os\r\n\r\n# Set the path of the folder containing the CSV files\r\nfolder_path = \"./LeetCode-Questions-CompanyWise\"\r\nheaders = [\r\n \"ID\",\r\n \"Title\",\r\n \"Acceptance\",\r\n \"Difficulty\",\r\n \"Frequency\",\r\n \"Leetcode Question Link\",\r\n]\r\n\r\n# Loop through all the CSV files in the folder\r\nfor file_name in os.listdir(folder_path):\r\n if file_name.endswith(\".csv\"):\r\n # Read the CSV file into a list of rows\r\n file_path = os.path.join(folder_path, file_name)\r\n with open(file_path, \"r\") as f:\r\n reader = csv.reader(f)\r\n rows = list(reader)\r\n\r\n has_headers = False\r\n if len(rows) > 0 and rows[0] == headers:\r\n has_headers = True\r\n\r\n if not has_headers:\r\n rows.insert(0, headers)\r\n\r\n # Write the list of rows back to the CSV file\r\n with open(file_path, \"w\", newline=\"\") as f:\r\n writer = csv.writer(f)\r\n writer.writerows(rows)\r\n\r\n```","shortMessageHtmlLink":"Chore: Add headers to all the files (krishnadey30#54)"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"Y3Vyc29yOnYyOpK7MjAyMy0wNC0wM1QyMDowMTozOS4xMDMxNDZazwAAAAMRT2wf","startCursor":"Y3Vyc29yOnYyOpK7MjAyMy0wNC0wM1QyMDowMTozOS4xMDMxNDZazwAAAAMRT2wf","endCursor":"Y3Vyc29yOnYyOpK7MjAyMy0wNC0wM1QyMDowMTozOS4xMDMxNDZazwAAAAMRT2wf"}},"title":"Activity ยท aryan-bhokare/LeetCode-Questions-CompanyWise"}